### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80245A40
/* 1662A0 80245A40 27BDFFD8 */  addiu     $sp, $sp, -0x28
glabel .L80245A44
/* 1662A4 80245A44 AFB3001C */  sw        $s3, 0x1C($sp)
D_80245A48:
/* 1662A8 80245A48 0080982D */  daddu     $s3, $a0, $zero
/* 1662AC 80245A4C 3C028025 */  lui       $v0, %hi(D_8024C08C)
D_80245A50:
/* 1662B0 80245A50 8C42C08C */  lw        $v0, %lo(D_8024C08C)($v0)
/* 1662B4 80245A54 3C030004 */  lui       $v1, (0x40000 >> 16)
D_80245A58:
/* 1662B8 80245A58 AFBF0020 */  sw        $ra, 0x20($sp)
/* 1662BC 80245A5C AFB20018 */  sw        $s2, 0x18($sp)
D_80245A60:
/* 1662C0 80245A60 AFB10014 */  sw        $s1, 0x14($sp)
/* 1662C4 80245A64 AFB00010 */  sw        $s0, 0x10($sp)
D_80245A68:
/* 1662C8 80245A68 92670003 */  lbu       $a3, 0x3($s3)
/* 1662CC 80245A6C 00431024 */  and       $v0, $v0, $v1
D_80245A70:
/* 1662D0 80245A70 1040001C */  beqz      $v0, .L80245AE4
/* 1662D4 80245A74 00000000 */   nop
D_80245A78:
/* 1662D8 80245A78 92620001 */  lbu       $v0, 0x1($s3)
/* 1662DC 80245A7C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1662E0 80245A80 A2620001 */  sb        $v0, 0x1($s3)
D_80245A84:
/* 1662E4 80245A84 00021600 */  sll       $v0, $v0, 24
/* 1662E8 80245A88 00022E03 */  sra       $a1, $v0, 24
/* 1662EC 80245A8C 04A20015 */  bltzl     $a1, .L80245AE4
.L80245A90:
/* 1662F0 80245A90 A2600001 */   sb       $zero, 0x1($s3)
/* 1662F4 80245A94 82620004 */  lb        $v0, 0x4($s3)
/* 1662F8 80245A98 82630005 */  lb        $v1, 0x5($s3)
/* 1662FC 80245A9C 00430018 */  mult      $v0, $v1
/* 166300 80245AA0 00006012 */  mflo      $t4
.L80245AA4:
/* 166304 80245AA4 82620006 */  lb        $v0, 0x6($s3)
D_80245AA8:
/* 166308 80245AA8 00000000 */  nop
glabel .L80245AAC
/* 16630C 80245AAC 01820018 */  mult      $t4, $v0
/* 166310 80245AB0 00002012 */  mflo      $a0
D_80245AB4:
/* 166314 80245AB4 82620002 */  lb        $v0, 0x2($s3)
D_80245AB8:
/* 166318 80245AB8 00000000 */  nop
D_80245ABC:
/* 16631C 80245ABC 00620018 */  mult      $v1, $v0
/* 166320 80245AC0 00001812 */  mflo      $v1
/* 166324 80245AC4 00831021 */  addu      $v0, $a0, $v1
glabel func_80245AC8
/* 166328 80245AC8 00451021 */  addu      $v0, $v0, $a1
/* 16632C 80245ACC 8E630008 */  lw        $v1, 0x8($s3)
D_80245AD0:
/* 166330 80245AD0 92640003 */  lbu       $a0, 0x3($s3)
/* 166334 80245AD4 00621821 */  addu      $v1, $v1, $v0
D_80245AD8:
/* 166338 80245AD8 90620000 */  lbu       $v0, 0x0($v1)
/* 16633C 80245ADC 1082FFE6 */  beq       $a0, $v0, D_80245A78
jtbl_80245AE0:
/* 166340 80245AE0 00000000 */   nop
.L80245AE4:
/* 166344 80245AE4 3C028025 */  lui       $v0, %hi(D_8024C08C)
D_80245AE8:
/* 166348 80245AE8 8C42C08C */  lw        $v0, %lo(D_8024C08C)($v0)
D_80245AEC:
/* 16634C 80245AEC 3C030008 */  lui       $v1, (0x80000 >> 16)
/* 166350 80245AF0 00431024 */  and       $v0, $v0, $v1
/* 166354 80245AF4 1040001E */  beqz      $v0, .L80245B70
D_80245AF8:
/* 166358 80245AF8 00000000 */   nop
/* 16635C 80245AFC 92660005 */  lbu       $a2, 0x5($s3)
/* 166360 80245B00 82650005 */  lb        $a1, 0x5($s3)
.L80245B04:
/* 166364 80245B04 92620001 */  lbu       $v0, 0x1($s3)
/* 166368 80245B08 24420001 */  addiu     $v0, $v0, 0x1
/* 16636C 80245B0C A2620001 */  sb        $v0, 0x1($s3)
jtbl_80245B10:
/* 166370 80245B10 00021600 */  sll       $v0, $v0, 24
D_80245B14:
/* 166374 80245B14 00022603 */  sra       $a0, $v0, 24
/* 166378 80245B18 0085102A */  slt       $v0, $a0, $a1
/* 16637C 80245B1C 1040003A */  beqz      $v0, .L80245C08
D_80245B20:
/* 166380 80245B20 24C2FFFF */   addiu    $v0, $a2, -0x1
/* 166384 80245B24 82620004 */  lb        $v0, 0x4($s3)
D_80245B28:
/* 166388 80245B28 00450018 */  mult      $v0, $a1
/* 16638C 80245B2C 00001812 */  mflo      $v1
D_80245B30:
/* 166390 80245B30 82620006 */  lb        $v0, 0x6($s3)
D_80245B34:
/* 166394 80245B34 00000000 */  nop
D_80245B38:
/* 166398 80245B38 00620018 */  mult      $v1, $v0
/* 16639C 80245B3C 00001812 */  mflo      $v1
D_80245B40:
/* 1663A0 80245B40 82620002 */  lb        $v0, 0x2($s3)
/* 1663A4 80245B44 00000000 */  nop
jtbl_80245B48:
/* 1663A8 80245B48 00A20018 */  mult      $a1, $v0
/* 1663AC 80245B4C 00006012 */  mflo      $t4
/* 1663B0 80245B50 006C1021 */  addu      $v0, $v1, $t4
/* 1663B4 80245B54 00441021 */  addu      $v0, $v0, $a0
/* 1663B8 80245B58 8E630008 */  lw        $v1, 0x8($s3)
/* 1663BC 80245B5C 92640003 */  lbu       $a0, 0x3($s3)
/* 1663C0 80245B60 00621821 */  addu      $v1, $v1, $v0
.L80245B64:
/* 1663C4 80245B64 90620000 */  lbu       $v0, 0x0($v1)
/* 1663C8 80245B68 1082FFE6 */  beq       $a0, $v0, .L80245B04
D_80245B6C:
/* 1663CC 80245B6C 00000000 */   nop
.L80245B70:
/* 1663D0 80245B70 3C028025 */  lui       $v0, %hi(D_8024C08C)
/* 1663D4 80245B74 8C42C08C */  lw        $v0, %lo(D_8024C08C)($v0)
/* 1663D8 80245B78 3C030001 */  lui       $v1, (0x10000 >> 16)
/* 1663DC 80245B7C 00431024 */  and       $v0, $v0, $v1
/* 1663E0 80245B80 10400007 */  beqz      $v0, D_80245BA0
/* 1663E4 80245B84 00000000 */   nop
/* 1663E8 80245B88 92620002 */  lbu       $v0, 0x2($s3)
/* 1663EC 80245B8C 2442FFFF */  addiu     $v0, $v0, -0x1
D_80245B90:
/* 1663F0 80245B90 A2620002 */  sb        $v0, 0x2($s3)
/* 1663F4 80245B94 00021600 */  sll       $v0, $v0, 24
D_80245B98:
/* 1663F8 80245B98 04420001 */  bltzl     $v0, D_80245BA0
/* 1663FC 80245B9C A2600002 */   sb       $zero, 0x2($s3)
D_80245BA0:
/* 166400 80245BA0 3C028025 */  lui       $v0, %hi(D_8024C08C)
.L80245BA4:
/* 166404 80245BA4 8C42C08C */  lw        $v0, %lo(D_8024C08C)($v0)
jtbl_80245BA8:
/* 166408 80245BA8 3C030002 */  lui       $v1, (0x20000 >> 16)
.L80245BAC:
/* 16640C 80245BAC 00431024 */  and       $v0, $v0, $v1
/* 166410 80245BB0 1040000C */  beqz      $v0, .L80245BE4
.L80245BB4:
/* 166414 80245BB4 00000000 */   nop
/* 166418 80245BB8 92620002 */  lbu       $v0, 0x2($s3)
/* 16641C 80245BBC 82630006 */  lb        $v1, 0x6($s3)
D_80245BC0:
/* 166420 80245BC0 24420001 */  addiu     $v0, $v0, 0x1
D_80245BC4:
/* 166424 80245BC4 A2620002 */  sb        $v0, 0x2($s3)
/* 166428 80245BC8 00021600 */  sll       $v0, $v0, 24
glabel func_80245BCC
/* 16642C 80245BCC 00021603 */  sra       $v0, $v0, 24
D_80245BD0:
/* 166430 80245BD0 0043102A */  slt       $v0, $v0, $v1
/* 166434 80245BD4 92630006 */  lbu       $v1, 0x6($s3)
jtbl_80245BD8:
/* 166438 80245BD8 14400002 */  bnez      $v0, .L80245BE4
.L80245BDC:
/* 16643C 80245BDC 2462FFFF */   addiu    $v0, $v1, -0x1
/* 166440 80245BE0 A2620002 */  sb        $v0, 0x2($s3)
.L80245BE4:
/* 166444 80245BE4 82630004 */  lb        $v1, 0x4($s3)
/* 166448 80245BE8 2C620005 */  sltiu     $v0, $v1, 0x5
/* 16644C 80245BEC 1040001F */  beqz      $v0, .L80245C6C
D_80245BF0:
/* 166450 80245BF0 00031080 */   sll      $v0, $v1, 2
D_80245BF4:
/* 166454 80245BF4 3C018025 */  lui       $at, %hi(jtbl_8024BF88)
.L80245BF8:
/* 166458 80245BF8 00220821 */  addu      $at, $at, $v0
/* 16645C 80245BFC 8C22BF88 */  lw        $v0, %lo(jtbl_8024BF88)($at)
/* 166460 80245C00 00400008 */  jr        $v0
D_80245C04:
/* 166464 80245C04 00000000 */   nop
.L80245C08:
/* 166468 80245C08 080916DC */  j         .L80245B70
/* 16646C 80245C0C A2620001 */   sb       $v0, 0x1($s3)
glabel .L80245C10
/* 166470 80245C10 82630001 */  lb        $v1, 0x1($s3)
/* 166474 80245C14 24020001 */  addiu     $v0, $zero, 0x1
.L80245C18:
/* 166478 80245C18 14620014 */  bne       $v1, $v0, .L80245C6C
D_80245C1C:
/* 16647C 80245C1C 00000000 */   nop
/* 166480 80245C20 92620002 */  lbu       $v0, 0x2($s3)
/* 166484 80245C24 2C420002 */  sltiu     $v0, $v0, 0x2
/* 166488 80245C28 54400010 */  bnel      $v0, $zero, .L80245C6C
/* 16648C 80245C2C A2600001 */   sb       $zero, 0x1($s3)
D_80245C30:
/* 166490 80245C30 0809171B */  j         .L80245C6C
/* 166494 80245C34 00000000 */   nop
glabel .L80245C38
/* 166498 80245C38 82630001 */  lb        $v1, 0x1($s3)
D_80245C3C:
/* 16649C 80245C3C 24020001 */  addiu     $v0, $zero, 0x1
.L80245C40:
/* 1664A0 80245C40 14620005 */  bne       $v1, $v0, .L80245C58
/* 1664A4 80245C44 00000000 */   nop
D_80245C48:
/* 1664A8 80245C48 92620002 */  lbu       $v0, 0x2($s3)
/* 1664AC 80245C4C 2C420002 */  sltiu     $v0, $v0, 0x2
/* 1664B0 80245C50 54400001 */  bnel      $v0, $zero, .L80245C58
/* 1664B4 80245C54 A2600001 */   sb       $zero, 0x1($s3)
.L80245C58:
/* 1664B8 80245C58 82630002 */  lb        $v1, 0x2($s3)
/* 1664BC 80245C5C 24020002 */  addiu     $v0, $zero, 0x2
.L80245C60:
/* 1664C0 80245C60 14620002 */  bne       $v1, $v0, .L80245C6C
/* 1664C4 80245C64 24020001 */   addiu    $v0, $zero, 0x1
/* 1664C8 80245C68 A2620001 */  sb        $v0, 0x1($s3)
.L80245C6C:
/* 1664CC 80245C6C 82620004 */  lb        $v0, 0x4($s3)
jtbl_80245C70:
/* 1664D0 80245C70 82630005 */  lb        $v1, 0x5($s3)
D_80245C74:
/* 1664D4 80245C74 00430018 */  mult      $v0, $v1
D_80245C78:
/* 1664D8 80245C78 00006012 */  mflo      $t4
/* 1664DC 80245C7C 82620006 */  lb        $v0, 0x6($s3)
glabel func_80245C80
/* 1664E0 80245C80 00000000 */  nop
/* 1664E4 80245C84 01820018 */  mult      $t4, $v0
.L80245C88:
/* 1664E8 80245C88 00002012 */  mflo      $a0
.L80245C8C:
/* 1664EC 80245C8C 82620002 */  lb        $v0, 0x2($s3)
/* 1664F0 80245C90 00000000 */  nop
/* 1664F4 80245C94 00620018 */  mult      $v1, $v0
/* 1664F8 80245C98 00001812 */  mflo      $v1
D_80245C9C:
/* 1664FC 80245C9C 00831821 */  addu      $v1, $a0, $v1
D_80245CA0:
/* 166500 80245CA0 82640001 */  lb        $a0, 0x1($s3)
/* 166504 80245CA4 8E620008 */  lw        $v0, 0x8($s3)
/* 166508 80245CA8 00641821 */  addu      $v1, $v1, $a0
.L80245CAC:
/* 16650C 80245CAC 00431021 */  addu      $v0, $v0, $v1
/* 166510 80245CB0 90420000 */  lbu       $v0, 0x0($v0)
D_80245CB4:
/* 166514 80245CB4 A2620003 */  sb        $v0, 0x3($s3)
/* 166518 80245CB8 304200FF */  andi      $v0, $v0, 0xFF
/* 16651C 80245CBC 10E20003 */  beq       $a3, $v0, .L80245CCC
/* 166520 80245CC0 00000000 */   nop
/* 166524 80245CC4 0C05272D */  jal       sfx_play_sound
/* 166528 80245CC8 24042101 */   addiu    $a0, $zero, 0x2101
.L80245CCC:
/* 16652C 80245CCC 82620004 */  lb        $v0, 0x4($s3)
/* 166530 80245CD0 14400022 */  bnez      $v0, .L80245D5C
.L80245CD4:
/* 166534 80245CD4 00000000 */   nop
D_80245CD8:
/* 166538 80245CD8 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 16653C 80245CDC 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
jtbl_80245CE0:
/* 166540 80245CE0 3C058025 */  lui       $a1, %hi(D_8024C084)
/* 166544 80245CE4 24A5C084 */  addiu     $a1, $a1, %lo(D_8024C084)
/* 166548 80245CE8 8CA20000 */  lw        $v0, 0x0($a1)
D_80245CEC:
/* 16654C 80245CEC 8E030000 */  lw        $v1, 0x0($s0)
D_80245CF0:
/* 166550 80245CF0 30422000 */  andi      $v0, $v0, 0x2000
glabel func_80245CF4
/* 166554 80245CF4 906400AB */  lbu       $a0, 0xAB($v1)
jtbl_80245CF8:
/* 166558 80245CF8 10400002 */  beqz      $v0, .L80245D04
/* 16655C 80245CFC 24020001 */   addiu    $v0, $zero, 0x1
/* 166560 80245D00 A06200AB */  sb        $v0, 0xAB($v1)
.L80245D04:
/* 166564 80245D04 8CA20000 */  lw        $v0, 0x0($a1)
/* 166568 80245D08 30420010 */  andi      $v0, $v0, 0x10
D_80245D0C:
/* 16656C 80245D0C 10400003 */  beqz      $v0, .L80245D1C
/* 166570 80245D10 00000000 */   nop
/* 166574 80245D14 8E020000 */  lw        $v0, 0x0($s0)
/* 166578 80245D18 A04000AB */  sb        $zero, 0xAB($v0)
.L80245D1C:
/* 16657C 80245D1C 8E020000 */  lw        $v0, 0x0($s0)
/* 166580 80245D20 904200AB */  lbu       $v0, 0xAB($v0)
D_80245D24:
/* 166584 80245D24 1082000D */  beq       $a0, $v0, .L80245D5C
D_80245D28:
/* 166588 80245D28 00000000 */   nop
/* 16658C 80245D2C 0C05272D */  jal       sfx_play_sound
D_80245D30:
/* 166590 80245D30 240400C8 */   addiu    $a0, $zero, 0xC8
D_80245D34:
/* 166594 80245D34 8E020000 */  lw        $v0, 0x0($s0)
D_80245D38:
/* 166598 80245D38 904200AB */  lbu       $v0, 0xAB($v0)
.L80245D3C:
/* 16659C 80245D3C 10400005 */  beqz      $v0, .L80245D54
D_80245D40:
/* 1665A0 80245D40 00000000 */   nop
/* 1665A4 80245D44 0C015857 */  jal       audio_set_stereo
D_80245D48:
/* 1665A8 80245D48 00000000 */   nop
/* 1665AC 80245D4C 08091757 */  j         .L80245D5C
D_80245D50:
/* 1665B0 80245D50 00000000 */   nop
.L80245D54:
/* 1665B4 80245D54 0C015860 */  jal       audio_set_mono
D_80245D58:
/* 1665B8 80245D58 00000000 */   nop
.L80245D5C:
/* 1665BC 80245D5C 3C038025 */  lui       $v1, %hi(D_8024C084)
D_80245D60:
/* 1665C0 80245D60 2463C084 */  addiu     $v1, $v1, %lo(D_8024C084)
/* 1665C4 80245D64 8C620000 */  lw        $v0, 0x0($v1)
jtbl_80245D68:
/* 1665C8 80245D68 30421000 */  andi      $v0, $v0, 0x1000
glabel func_80245D6C
/* 1665CC 80245D6C 10400009 */  beqz      $v0, .L80245D94
D_80245D70:
/* 1665D0 80245D70 00000000 */   nop
/* 1665D4 80245D74 82620004 */  lb        $v0, 0x4($s3)
D_80245D78:
/* 1665D8 80245D78 14400006 */  bnez      $v0, .L80245D94
/* 1665DC 80245D7C 00000000 */   nop
D_80245D80:
/* 1665E0 80245D80 92620003 */  lbu       $v0, 0x3($s3)
/* 1665E4 80245D84 2C420004 */  sltiu     $v0, $v0, 0x4
D_80245D88:
/* 1665E8 80245D88 10400002 */  beqz      $v0, .L80245D94
/* 1665EC 80245D8C 34028000 */   ori      $v0, $zero, 0x8000
D_80245D90:
/* 1665F0 80245D90 AC620000 */  sw        $v0, 0x0($v1)
.L80245D94:
/* 1665F4 80245D94 3C028025 */  lui       $v0, %hi(D_8024C084)
D_80245D98:
/* 1665F8 80245D98 8C42C084 */  lw        $v0, %lo(D_8024C084)($v0)
/* 1665FC 80245D9C 30428000 */  andi      $v0, $v0, 0x8000
jtbl_80245DA0:
/* 166600 80245DA0 104002D1 */  beqz      $v0, .L802468E8
/* 166604 80245DA4 00000000 */   nop
.L80245DA8:
/* 166608 80245DA8 82630004 */  lb        $v1, 0x4($s3)
/* 16660C 80245DAC 2C620005 */  sltiu     $v0, $v1, 0x5
D_80245DB0:
/* 166610 80245DB0 104002CD */  beqz      $v0, .L802468E8
/* 166614 80245DB4 0000202D */   daddu    $a0, $zero, $zero
/* 166618 80245DB8 00031080 */  sll       $v0, $v1, 2
/* 16661C 80245DBC 3C018025 */  lui       $at, %hi(jtbl_8024BFA0)
D_80245DC0:
/* 166620 80245DC0 00220821 */  addu      $at, $at, $v0
.L80245DC4:
/* 166624 80245DC4 8C22BFA0 */  lw        $v0, %lo(jtbl_8024BFA0)($at)
/* 166628 80245DC8 00400008 */  jr        $v0
/* 16662C 80245DCC 00000000 */   nop
glabel .L80245DD0
/* 166630 80245DD0 92620003 */  lbu       $v0, 0x3($s3)
D_80245DD4:
/* 166634 80245DD4 2C420004 */  sltiu     $v0, $v0, 0x4
/* 166638 80245DD8 10400007 */  beqz      $v0, .L80245DF8
/* 16663C 80245DDC 00000000 */   nop
D_80245DE0:
/* 166640 80245DE0 92620003 */  lbu       $v0, 0x3($s3)
D_80245DE4:
/* 166644 80245DE4 3C018007 */  lui       $at, %hi(gSaveSlotHasData)
/* 166648 80245DE8 00220821 */  addu      $at, $at, $v0
/* 16664C 80245DEC 90227A24 */  lbu       $v0, %lo(gSaveSlotHasData)($at)
/* 166650 80245DF0 50400001 */  beql      $v0, $zero, .L80245DF8
/* 166654 80245DF4 24040001 */   addiu    $a0, $zero, 0x1
.L80245DF8:
/* 166658 80245DF8 10800040 */  beqz      $a0, .L80245EFC
/* 16665C 80245DFC 240400F7 */   addiu    $a0, $zero, 0xF7
D_80245E00:
/* 166660 80245E00 24030007 */  addiu     $v1, $zero, 0x7
/* 166664 80245E04 3C028025 */  lui       $v0, %hi(D_8024C117)
/* 166668 80245E08 2442C117 */  addiu     $v0, $v0, %lo(D_8024C117)
.L80245E0C:
/* 16666C 80245E0C A0440000 */  sb        $a0, 0x0($v0)
/* 166670 80245E10 2463FFFF */  addiu     $v1, $v1, -0x1
/* 166674 80245E14 0461FFFD */  bgez      $v1, .L80245E0C
/* 166678 80245E18 2442FFFF */   addiu    $v0, $v0, -0x1
/* 16667C 80245E1C 24040030 */  addiu     $a0, $zero, 0x30
.L80245E20:
/* 166680 80245E20 3C108024 */  lui       $s0, %hi(func_80243380)
D_80245E24:
/* 166684 80245E24 26103380 */  addiu     $s0, $s0, %lo(func_80243380)
/* 166688 80245E28 3C018025 */  lui       $at, %hi(D_8024C090)
flo_00_pad_5E2C:
/* 16668C 80245E2C A020C090 */  sb        $zero, %lo(D_8024C090)($at)
D_80245E30:
/* 166690 80245E30 0C051F9F */  jal       set_window_update
/* 166694 80245E34 0200282D */   daddu    $a1, $s0, $zero
/* 166698 80245E38 24040031 */  addiu     $a0, $zero, 0x31
/* 16669C 80245E3C 0C051F9F */  jal       set_window_update
.L80245E40:
/* 1666A0 80245E40 0200282D */   daddu    $a1, $s0, $zero
D_80245E44:
/* 1666A4 80245E44 2404002D */  addiu     $a0, $zero, 0x2D
/* 1666A8 80245E48 3C108024 */  lui       $s0, %hi(D_80243898)
/* 1666AC 80245E4C 26103898 */  addiu     $s0, $s0, %lo(D_80243898)
.L80245E50:
/* 1666B0 80245E50 0C051F9F */  jal       set_window_update
/* 1666B4 80245E54 0200282D */   daddu    $a1, $s0, $zero
D_80245E58:
/* 1666B8 80245E58 24040033 */  addiu     $a0, $zero, 0x33
D_80245E5C:
/* 1666BC 80245E5C 0C051F9F */  jal       set_window_update
/* 1666C0 80245E60 0200282D */   daddu    $a1, $s0, $zero
D_80245E64:
/* 1666C4 80245E64 24040034 */  addiu     $a0, $zero, 0x34
.L80245E68:
/* 1666C8 80245E68 0C051F9F */  jal       set_window_update
D_80245E6C:
/* 1666CC 80245E6C 0200282D */   daddu    $a1, $s0, $zero
/* 1666D0 80245E70 24040035 */  addiu     $a0, $zero, 0x35
/* 1666D4 80245E74 0C051F9F */  jal       set_window_update
/* 1666D8 80245E78 0200282D */   daddu    $a1, $s0, $zero
/* 1666DC 80245E7C 24040036 */  addiu     $a0, $zero, 0x36
D_80245E80:
/* 1666E0 80245E80 0C051F9F */  jal       set_window_update
D_80245E84:
/* 1666E4 80245E84 0200282D */   daddu    $a1, $s0, $zero
D_80245E88:
/* 1666E8 80245E88 24040037 */  addiu     $a0, $zero, 0x37
.L80245E8C:
/* 1666EC 80245E8C 0C051F9F */  jal       set_window_update
/* 1666F0 80245E90 0200282D */   daddu    $a1, $s0, $zero
/* 1666F4 80245E94 24040035 */  addiu     $a0, $zero, 0x35
D_80245E98:
/* 1666F8 80245E98 0C051F9F */  jal       set_window_update
glabel func_80245E9C
/* 1666FC 80245E9C 0200282D */   daddu    $a1, $s0, $zero
/* 166700 80245EA0 24040038 */  addiu     $a0, $zero, 0x38
/* 166704 80245EA4 0C051F9F */  jal       set_window_update
/* 166708 80245EA8 0200282D */   daddu    $a1, $s0, $zero
/* 16670C 80245EAC 24040039 */  addiu     $a0, $zero, 0x39
/* 166710 80245EB0 0C051F9F */  jal       set_window_update
/* 166714 80245EB4 0200282D */   daddu    $a1, $s0, $zero
D_80245EB8:
/* 166718 80245EB8 2404003A */  addiu     $a0, $zero, 0x3A
/* 16671C 80245EBC 0C051F9F */  jal       set_window_update
.L80245EC0:
/* 166720 80245EC0 0200282D */   daddu    $a1, $s0, $zero
/* 166724 80245EC4 2404003B */  addiu     $a0, $zero, 0x3B
/* 166728 80245EC8 0C051F9F */  jal       set_window_update
/* 16672C 80245ECC 0200282D */   daddu    $a1, $s0, $zero
/* 166730 80245ED0 0C05272D */  jal       sfx_play_sound
/* 166734 80245ED4 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166738 80245ED8 0000282D */  daddu     $a1, $zero, $zero
D_80245EDC:
/* 16673C 80245EDC 00A0302D */  daddu     $a2, $a1, $zero
D_80245EE0:
/* 166740 80245EE0 3C048025 */  lui       $a0, %hi(D_80249B90)
/* 166744 80245EE4 8C849B90 */  lw        $a0, %lo(D_80249B90)($a0)
jtbl_80245EE8:
/* 166748 80245EE8 24020003 */  addiu     $v0, $zero, 0x3
D_80245EEC:
/* 16674C 80245EEC 3C018025 */  lui       $at, %hi(D_8024C098_C09918)
/* 166750 80245EF0 A022C098 */  sb        $v0, %lo(D_8024C098_C09918)($at)
/* 166754 80245EF4 08091A38 */  j         .L802468E0
.L80245EF8:
/* 166758 80245EF8 A0800004 */   sb       $zero, 0x4($a0)
.L80245EFC:
/* 16675C 80245EFC 92630003 */  lbu       $v1, 0x3($s3)
/* 166760 80245F00 24020006 */  addiu     $v0, $zero, 0x6
/* 166764 80245F04 1462002C */  bne       $v1, $v0, .L80245FB8
D_80245F08:
/* 166768 80245F08 24020004 */   addiu    $v0, $zero, 0x4
/* 16676C 80245F0C 24040033 */  addiu     $a0, $zero, 0x33
D_80245F10:
/* 166770 80245F10 3C128024 */  lui       $s2, %hi(D_8024368C)
/* 166774 80245F14 2652368C */  addiu     $s2, $s2, %lo(D_8024368C)
D_80245F18:
/* 166778 80245F18 0C051F9F */  jal       set_window_update
/* 16677C 80245F1C 0240282D */   daddu    $a1, $s2, $zero
D_80245F20:
/* 166780 80245F20 24040034 */  addiu     $a0, $zero, 0x34
/* 166784 80245F24 3C118024 */  lui       $s1, %hi(func_802436F0)
.L80245F28:
/* 166788 80245F28 263136F0 */  addiu     $s1, $s1, %lo(func_802436F0)
.L80245F2C:
/* 16678C 80245F2C 0C051F9F */  jal       set_window_update
D_80245F30:
/* 166790 80245F30 0220282D */   daddu    $a1, $s1, $zero
/* 166794 80245F34 24040035 */  addiu     $a0, $zero, 0x35
D_80245F38:
/* 166798 80245F38 3C108024 */  lui       $s0, %hi(dead_flo_16_SuperBlock_UpgradeOrbAngles)
/* 16679C 80245F3C 261037B8 */  addiu     $s0, $s0, %lo(dead_flo_16_SuperBlock_UpgradeOrbAngles)
D_80245F40:
/* 1667A0 80245F40 0C051F9F */  jal       set_window_update
D_80245F44:
/* 1667A4 80245F44 0200282D */   daddu    $a1, $s0, $zero
D_80245F48:
/* 1667A8 80245F48 24040036 */  addiu     $a0, $zero, 0x36
D_80245F4C:
/* 1667AC 80245F4C 0C051F9F */  jal       set_window_update
jtbl_80245F50:
/* 1667B0 80245F50 0200282D */   daddu    $a1, $s0, $zero
/* 1667B4 80245F54 24040037 */  addiu     $a0, $zero, 0x37
/* 1667B8 80245F58 0C051F9F */  jal       set_window_update
D_80245F5C:
/* 1667BC 80245F5C 0200282D */   daddu    $a1, $s0, $zero
D_80245F60:
/* 1667C0 80245F60 24040038 */  addiu     $a0, $zero, 0x38
/* 1667C4 80245F64 0C051F9F */  jal       set_window_update
.L80245F68:
/* 1667C8 80245F68 0240282D */   daddu    $a1, $s2, $zero
/* 1667CC 80245F6C 24040039 */  addiu     $a0, $zero, 0x39
/* 1667D0 80245F70 0C051F9F */  jal       set_window_update
.L80245F74:
/* 1667D4 80245F74 0220282D */   daddu    $a1, $s1, $zero
.L80245F78:
/* 1667D8 80245F78 2404003A */  addiu     $a0, $zero, 0x3A
/* 1667DC 80245F7C 0C051F9F */  jal       set_window_update
/* 1667E0 80245F80 0240282D */   daddu    $a1, $s2, $zero
/* 1667E4 80245F84 2404003B */  addiu     $a0, $zero, 0x3B
/* 1667E8 80245F88 0C051F9F */  jal       set_window_update
D_80245F8C:
/* 1667EC 80245F8C 0220282D */   daddu    $a1, $s1, $zero
/* 1667F0 80245F90 3C058024 */  lui       $a1, %hi(func_80243754)
/* 1667F4 80245F94 24A53754 */  addiu     $a1, $a1, %lo(func_80243754)
.L80245F98:
/* 1667F8 80245F98 0C051F9F */  jal       set_window_update
.L80245F9C:
/* 1667FC 80245F9C 2404002D */   addiu    $a0, $zero, 0x2D
.L80245FA0:
/* 166800 80245FA0 0C05272D */  jal       sfx_play_sound
/* 166804 80245FA4 240400D6 */   addiu    $a0, $zero, 0xD6
D_80245FA8:
/* 166808 80245FA8 0C00CD3C */  jal       set_game_mode
/* 16680C 80245FAC 2404000F */   addiu    $a0, $zero, 0xF
.L80245FB0:
/* 166810 80245FB0 08091A3A */  j         .L802468E8
/* 166814 80245FB4 00000000 */   nop
.L80245FB8:
/* 166818 80245FB8 14620005 */  bne       $v1, $v0, .L80245FD0
glabel func_80245FBC
/* 16681C 80245FBC 24020005 */   addiu    $v0, $zero, 0x5
/* 166820 80245FC0 0C05272D */  jal       sfx_play_sound
/* 166824 80245FC4 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166828 80245FC8 080917F9 */  j         .L80245FE4
D_80245FCC:
/* 16682C 80245FCC 24020001 */   addiu    $v0, $zero, 0x1
.L80245FD0:
/* 166830 80245FD0 1462001B */  bne       $v1, $v0, .L80246040
/* 166834 80245FD4 2C620004 */   sltiu    $v0, $v1, 0x4
/* 166838 80245FD8 0C05272D */  jal       sfx_play_sound
/* 16683C 80245FDC 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166840 80245FE0 24020003 */  addiu     $v0, $zero, 0x3
.L80245FE4:
/* 166844 80245FE4 A2620004 */  sb        $v0, 0x4($s3)
D_80245FE8:
/* 166848 80245FE8 0260202D */  daddu     $a0, $s3, $zero
/* 16684C 80245FEC 24050001 */  addiu     $a1, $zero, 0x1
.L80245FF0:
/* 166850 80245FF0 0C090B65 */  jal       func_80242D94
/* 166854 80245FF4 24060002 */   addiu    $a2, $zero, 0x2
/* 166858 80245FF8 3C058024 */  lui       $a1, %hi(D_8024368C)
/* 16685C 80245FFC 24A5368C */  addiu     $a1, $a1, %lo(D_8024368C)
/* 166860 80246000 0C051F9F */  jal       set_window_update
/* 166864 80246004 24040033 */   addiu    $a0, $zero, 0x33
/* 166868 80246008 3C058024 */  lui       $a1, %hi(func_802436F0)
.L8024600C:
/* 16686C 8024600C 24A536F0 */  addiu     $a1, $a1, %lo(func_802436F0)
.L80246010:
/* 166870 80246010 0C051F9F */  jal       set_window_update
/* 166874 80246014 24040034 */   addiu    $a0, $zero, 0x34
/* 166878 80246018 24040035 */  addiu     $a0, $zero, 0x35
/* 16687C 8024601C 3C108024 */  lui       $s0, %hi(dead_flo_16_SuperBlock_UpgradeOrbAngles)
D_80246020:
/* 166880 80246020 261037B8 */  addiu     $s0, $s0, %lo(dead_flo_16_SuperBlock_UpgradeOrbAngles)
glabel func_80246024
/* 166884 80246024 0C051F9F */  jal       set_window_update
/* 166888 80246028 0200282D */   daddu    $a1, $s0, $zero
/* 16688C 8024602C 24040037 */  addiu     $a0, $zero, 0x37
/* 166890 80246030 0C051F9F */  jal       set_window_update
/* 166894 80246034 0200282D */   daddu    $a1, $s0, $zero
D_80246038:
/* 166898 80246038 08091A3A */  j         .L802468E8
D_8024603C:
/* 16689C 8024603C 00000000 */   nop
.L80246040:
/* 1668A0 80246040 10400229 */  beqz      $v0, .L802468E8
/* 1668A4 80246044 00000000 */   nop
/* 1668A8 80246048 0C05272D */  jal       sfx_play_sound
/* 1668AC 8024604C 240400C9 */   addiu    $a0, $zero, 0xC9
/* 1668B0 80246050 2404002D */  addiu     $a0, $zero, 0x2D
/* 1668B4 80246054 3C108024 */  lui       $s0, %hi(D_80243898)
/* 1668B8 80246058 26103898 */  addiu     $s0, $s0, %lo(D_80243898)
.L8024605C:
/* 1668BC 8024605C 0C051F9F */  jal       set_window_update
.L80246060:
/* 1668C0 80246060 0200282D */   daddu    $a1, $s0, $zero
/* 1668C4 80246064 24040033 */  addiu     $a0, $zero, 0x33
D_80246068:
/* 1668C8 80246068 0C051F9F */  jal       set_window_update
/* 1668CC 8024606C 0200282D */   daddu    $a1, $s0, $zero
.L80246070:
/* 1668D0 80246070 24040034 */  addiu     $a0, $zero, 0x34
/* 1668D4 80246074 0C051F9F */  jal       set_window_update
/* 1668D8 80246078 0200282D */   daddu    $a1, $s0, $zero
/* 1668DC 8024607C 24040035 */  addiu     $a0, $zero, 0x35
/* 1668E0 80246080 0C051F9F */  jal       set_window_update
/* 1668E4 80246084 0200282D */   daddu    $a1, $s0, $zero
/* 1668E8 80246088 24040036 */  addiu     $a0, $zero, 0x36
/* 1668EC 8024608C 0C051F9F */  jal       set_window_update
D_80246090:
/* 1668F0 80246090 0200282D */   daddu    $a1, $s0, $zero
D_80246094:
/* 1668F4 80246094 24040037 */  addiu     $a0, $zero, 0x37
/* 1668F8 80246098 0C051F9F */  jal       set_window_update
.L8024609C:
/* 1668FC 8024609C 0200282D */   daddu    $a1, $s0, $zero
.L802460A0:
/* 166900 802460A0 24040035 */  addiu     $a0, $zero, 0x35
/* 166904 802460A4 0C051F9F */  jal       set_window_update
/* 166908 802460A8 0200282D */   daddu    $a1, $s0, $zero
.L802460AC:
/* 16690C 802460AC 24040038 */  addiu     $a0, $zero, 0x38
/* 166910 802460B0 0C051F9F */  jal       set_window_update
/* 166914 802460B4 0200282D */   daddu    $a1, $s0, $zero
/* 166918 802460B8 24040039 */  addiu     $a0, $zero, 0x39
.L802460BC:
/* 16691C 802460BC 0C051F9F */  jal       set_window_update
/* 166920 802460C0 0200282D */   daddu    $a1, $s0, $zero
/* 166924 802460C4 2404003A */  addiu     $a0, $zero, 0x3A
/* 166928 802460C8 0C051F9F */  jal       set_window_update
/* 16692C 802460CC 0200282D */   daddu    $a1, $s0, $zero
.L802460D0:
/* 166930 802460D0 2404003B */  addiu     $a0, $zero, 0x3B
/* 166934 802460D4 0C051F9F */  jal       set_window_update
/* 166938 802460D8 0200282D */   daddu    $a1, $s0, $zero
/* 16693C 802460DC 92640003 */  lbu       $a0, 0x3($s3)
jtbl_802460E0:
/* 166940 802460E0 3C058024 */  lui       $a1, %hi(func_80243908)
glabel func_802460E4
/* 166944 802460E4 24A53908 */  addiu     $a1, $a1, %lo(func_80243908)
/* 166948 802460E8 0C051F9F */  jal       set_window_update
D_802460EC:
/* 16694C 802460EC 24840038 */   addiu    $a0, $a0, 0x38
/* 166950 802460F0 0C05272D */  jal       sfx_play_sound
/* 166954 802460F4 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166958 802460F8 24040032 */  addiu     $a0, $zero, 0x32
/* 16695C 802460FC 0C051F9F */  jal       set_window_update
/* 166960 80246100 24050001 */   addiu    $a1, $zero, 0x1
.L80246104:
/* 166964 80246104 3C048016 */  lui       $a0, %hi(gWindows)
D_80246108:
/* 166968 80246108 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
/* 16696C 8024610C 2402008F */  addiu     $v0, $zero, 0x8F
/* 166970 80246110 A482064E */  sh        $v0, 0x64E($a0)
/* 166974 80246114 24020045 */  addiu     $v0, $zero, 0x45
/* 166978 80246118 A4820650 */  sh        $v0, 0x650($a0)
/* 16697C 8024611C 2402002C */  addiu     $v0, $zero, 0x2C
.L80246120:
/* 166980 80246120 80830643 */  lb        $v1, 0x643($a0)
/* 166984 80246124 A4820652 */  sh        $v0, 0x652($a0)
/* 166988 80246128 2402FFFF */  addiu     $v0, $zero, -0x1
/* 16698C 8024612C 1062000B */  beq       $v1, $v0, .L8024615C
jtbl_80246130:
/* 166990 80246130 2485064C */   addiu    $a1, $a0, 0x64C
/* 166994 80246134 00031140 */  sll       $v0, $v1, 5
.L80246138:
/* 166998 80246138 00441021 */  addu      $v0, $v0, $a0
/* 16699C 8024613C 94420010 */  lhu       $v0, 0x10($v0)
D_80246140:
/* 1669A0 80246140 00021400 */  sll       $v0, $v0, 16
.L80246144:
/* 1669A4 80246144 00021C03 */  sra       $v1, $v0, 16
/* 1669A8 80246148 000217C2 */  srl       $v0, $v0, 31
/* 1669AC 8024614C 00621821 */  addu      $v1, $v1, $v0
D_80246150:
/* 1669B0 80246150 00031843 */  sra       $v1, $v1, 1
/* 1669B4 80246154 0809185A */  j         .L80246168
/* 1669B8 80246158 2463FFDE */   addiu    $v1, $v1, -0x22
.L8024615C:
/* 1669BC 8024615C 2403007E */  addiu     $v1, $zero, 0x7E
jtbl_80246160:
/* 1669C0 80246160 3C048016 */  lui       $a0, %hi(gWindows)
/* 1669C4 80246164 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
.L80246168:
/* 1669C8 80246168 2402FFE3 */  addiu     $v0, $zero, -0x1D
/* 1669CC 8024616C A4A30000 */  sh        $v1, 0x0($a1)
D_80246170:
/* 1669D0 80246170 A48205CE */  sh        $v0, 0x5CE($a0)
/* 1669D4 80246174 240200C0 */  addiu     $v0, $zero, 0xC0
.L80246178:
/* 1669D8 80246178 A48205D0 */  sh        $v0, 0x5D0($a0)
/* 1669DC 8024617C 24020019 */  addiu     $v0, $zero, 0x19
/* 1669E0 80246180 808305C3 */  lb        $v1, 0x5C3($a0)
D_80246184:
/* 1669E4 80246184 A48205D2 */  sh        $v0, 0x5D2($a0)
/* 1669E8 80246188 2402FFFF */  addiu     $v0, $zero, -0x1
.L8024618C:
/* 1669EC 8024618C 1062000B */  beq       $v1, $v0, .L802461BC
/* 1669F0 80246190 248705CC */   addiu    $a3, $a0, 0x5CC
glabel .L80246194
/* 1669F4 80246194 00031140 */  sll       $v0, $v1, 5
.L80246198:
/* 1669F8 80246198 00441021 */  addu      $v0, $v0, $a0
glabel .L8024619C
/* 1669FC 8024619C 94420010 */  lhu       $v0, 0x10($v0)
.L802461A0:
/* 166A00 802461A0 00021400 */  sll       $v0, $v0, 16
glabel .L802461A4
/* 166A04 802461A4 00021C03 */  sra       $v1, $v0, 16
/* 166A08 802461A8 000217C2 */  srl       $v0, $v0, 31
glabel .L802461AC
/* 166A0C 802461AC 00621821 */  addu      $v1, $v1, $v0
jtbl_802461B0:
/* 166A10 802461B0 00031843 */  sra       $v1, $v1, 1
D_802461B4:
/* 166A14 802461B4 08091870 */  j         D_802461C0
/* 166A18 802461B8 2463FFA0 */   addiu    $v1, $v1, -0x60
glabel .L802461BC
/* 166A1C 802461BC 24030040 */  addiu     $v1, $zero, 0x40
D_802461C0:
/* 166A20 802461C0 0000282D */  daddu     $a1, $zero, $zero
glabel .L802461C4
/* 166A24 802461C4 00A0302D */  daddu     $a2, $a1, $zero
/* 166A28 802461C8 A4E30000 */  sh        $v1, 0x0($a3)
glabel .L802461CC
/* 166A2C 802461CC 3C048025 */  lui       $a0, %hi(D_80249B88)
/* 166A30 802461D0 8C849B88 */  lw        $a0, %lo(D_80249B88)($a0)
.L802461D4:
/* 166A34 802461D4 24020001 */  addiu     $v0, $zero, 0x1
/* 166A38 802461D8 3C018025 */  lui       $at, %hi(D_8024C098_C09918)
.L802461DC:
/* 166A3C 802461DC A022C098 */  sb        $v0, %lo(D_8024C098_C09918)($at)
/* 166A40 802461E0 08091A37 */  j         .L802468DC
D_802461E4:
/* 166A44 802461E4 24020004 */   addiu    $v0, $zero, 0x4
glabel .L802461E8
/* 166A48 802461E8 92630003 */  lbu       $v1, 0x3($s3)
/* 166A4C 802461EC 24020006 */  addiu     $v0, $zero, 0x6
kkj_19_D_802461F0:
/* 166A50 802461F0 14620018 */  bne       $v1, $v0, .L80246254
D_802461F4:
/* 166A54 802461F4 2C620004 */   sltiu    $v0, $v1, 0x4
/* 166A58 802461F8 0C05272D */  jal       sfx_play_sound
/* 166A5C 802461FC 240400C9 */   addiu    $a0, $zero, 0xC9
.L80246200:
/* 166A60 80246200 A2600004 */  sb        $zero, 0x4($s3)
/* 166A64 80246204 3C058024 */  lui       $a1, %hi(func_802433F4)
/* 166A68 80246208 24A533F4 */  addiu     $a1, $a1, %lo(func_802433F4)
.L8024620C:
/* 166A6C 8024620C 0C051F9F */  jal       set_window_update
D_80246210:
/* 166A70 80246210 24040033 */   addiu    $a0, $zero, 0x33
.L80246214:
/* 166A74 80246214 3C058024 */  lui       $a1, %hi(func_80243468)
/* 166A78 80246218 24A53468 */  addiu     $a1, $a1, %lo(func_80243468)
/* 166A7C 8024621C 0C051F9F */  jal       set_window_update
/* 166A80 80246220 24040034 */   addiu    $a0, $zero, 0x34
D_80246224:
/* 166A84 80246224 24040035 */  addiu     $a0, $zero, 0x35
/* 166A88 80246228 3C108024 */  lui       $s0, %hi(D_802434DC)
/* 166A8C 8024622C 261034DC */  addiu     $s0, $s0, %lo(D_802434DC)
.L80246230:
/* 166A90 80246230 0C051F9F */  jal       set_window_update
/* 166A94 80246234 0200282D */   daddu    $a1, $s0, $zero
/* 166A98 80246238 24040037 */  addiu     $a0, $zero, 0x37
/* 166A9C 8024623C 0C051F9F */  jal       set_window_update
.L80246240:
/* 166AA0 80246240 0200282D */   daddu    $a1, $s0, $zero
/* 166AA4 80246244 0260202D */  daddu     $a0, $s3, $zero
/* 166AA8 80246248 0000282D */  daddu     $a1, $zero, $zero
/* 166AAC 8024624C 08091A38 */  j         .L802468E0
/* 166AB0 80246250 24060002 */   addiu    $a2, $zero, 0x2
.L80246254:
/* 166AB4 80246254 104001A4 */  beqz      $v0, .L802468E8
/* 166AB8 80246258 00000000 */   nop
D_8024625C:
/* 166ABC 8024625C 92620003 */  lbu       $v0, 0x3($s3)
hos_06_D_80246260:
/* 166AC0 80246260 3C018007 */  lui       $at, %hi(gSaveSlotHasData)
D_80246264:
/* 166AC4 80246264 00220821 */  addu      $at, $at, $v0
/* 166AC8 80246268 90227A24 */  lbu       $v0, %lo(gSaveSlotHasData)($at)
D_8024626C:
/* 166ACC 8024626C 1040007F */  beqz      $v0, .L8024646C
D_80246270:
/* 166AD0 80246270 00000000 */   nop
/* 166AD4 80246274 0C05272D */  jal       sfx_play_sound
D_80246278:
/* 166AD8 80246278 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166ADC 8024627C 3C058024 */  lui       $a1, %hi(func_80243CCC)
D_80246280:
/* 166AE0 80246280 24A53CCC */  addiu     $a1, $a1, %lo(func_80243CCC)
.L80246284:
/* 166AE4 80246284 0C051F9F */  jal       set_window_update
jtbl_80246288:
/* 166AE8 80246288 24040032 */   addiu    $a0, $zero, 0x32
/* 166AEC 8024628C 3C048016 */  lui       $a0, %hi(gWindows)
D_80246290:
/* 166AF0 80246290 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
/* 166AF4 80246294 24020079 */  addiu     $v0, $zero, 0x79
.L80246298:
/* 166AF8 80246298 A482064E */  sh        $v0, 0x64E($a0)
/* 166AFC 8024629C 24020045 */  addiu     $v0, $zero, 0x45
/* 166B00 802462A0 A4820650 */  sh        $v0, 0x650($a0)
D_802462A4:
/* 166B04 802462A4 2402002C */  addiu     $v0, $zero, 0x2C
/* 166B08 802462A8 80830643 */  lb        $v1, 0x643($a0)
/* 166B0C 802462AC A4820652 */  sh        $v0, 0x652($a0)
/* 166B10 802462B0 2402FFFF */  addiu     $v0, $zero, -0x1
/* 166B14 802462B4 1062000B */  beq       $v1, $v0, D_802462E4
.L802462B8:
/* 166B18 802462B8 2485064C */   addiu    $a1, $a0, 0x64C
/* 166B1C 802462BC 00031140 */  sll       $v0, $v1, 5
flo_08_ItemChoiceList:
/* 166B20 802462C0 00441021 */  addu      $v0, $v0, $a0
/* 166B24 802462C4 94420010 */  lhu       $v0, 0x10($v0)
jtbl_802462C8:
/* 166B28 802462C8 00021400 */  sll       $v0, $v0, 16
.L802462CC:
/* 166B2C 802462CC 00021C03 */  sra       $v1, $v0, 16
D_802462D0:
/* 166B30 802462D0 000217C2 */  srl       $v0, $v0, 31
/* 166B34 802462D4 00621821 */  addu      $v1, $v1, $v0
glabel .L802462D8
/* 166B38 802462D8 00031843 */  sra       $v1, $v1, 1
/* 166B3C 802462DC 080918BC */  j         .L802462F0
D_802462E0:
/* 166B40 802462E0 2463FFDE */   addiu    $v1, $v1, -0x22
D_802462E4:
/* 166B44 802462E4 2403007E */  addiu     $v1, $zero, 0x7E
/* 166B48 802462E8 3C048016 */  lui       $a0, %hi(gWindows)
/* 166B4C 802462EC 24849D50 */  addiu     $a0, $a0, %lo(gWindows)
glabel .L802462F0
/* 166B50 802462F0 2402FFE3 */  addiu     $v0, $zero, -0x1D
/* 166B54 802462F4 A4A30000 */  sh        $v1, 0x0($a1)
/* 166B58 802462F8 A48205CE */  sh        $v0, 0x5CE($a0)
/* 166B5C 802462FC 24020076 */  addiu     $v0, $zero, 0x76
glabel D_80246300
/* 166B60 80246300 A48205D0 */  sh        $v0, 0x5D0($a0)
.L80246304:
/* 166B64 80246304 24020019 */  addiu     $v0, $zero, 0x19
/* 166B68 80246308 808305C3 */  lb        $v1, 0x5C3($a0)
/* 166B6C 8024630C A48205D2 */  sh        $v0, 0x5D2($a0)
D_80246310:
/* 166B70 80246310 2402FFFF */  addiu     $v0, $zero, -0x1
/* 166B74 80246314 1062000B */  beq       $v1, $v0, .L80246344
glabel .L80246318
/* 166B78 80246318 248705CC */   addiu    $a3, $a0, 0x5CC
/* 166B7C 8024631C 00031140 */  sll       $v0, $v1, 5
glabel .L80246320
/* 166B80 80246320 00441021 */  addu      $v0, $v0, $a0
/* 166B84 80246324 94420010 */  lhu       $v0, 0x10($v0)
glabel .L80246328
/* 166B88 80246328 00021400 */  sll       $v0, $v0, 16
/* 166B8C 8024632C 00021C03 */  sra       $v1, $v0, 16
glabel .L80246330
/* 166B90 80246330 000217C2 */  srl       $v0, $v0, 31
/* 166B94 80246334 00621821 */  addu      $v1, $v1, $v0
glabel .L80246338
/* 166B98 80246338 00031843 */  sra       $v1, $v1, 1
/* 166B9C 8024633C 080918D2 */  j         .L80246348
glabel .L80246340
/* 166BA0 80246340 2463FFC5 */   addiu    $v1, $v1, -0x3B
.L80246344:
/* 166BA4 80246344 24030065 */  addiu     $v1, $zero, 0x65
glabel .L80246348
/* 166BA8 80246348 0000282D */  daddu     $a1, $zero, $zero
/* 166BAC 8024634C 24060001 */  addiu     $a2, $zero, 0x1
D_80246350:
/* 166BB0 80246350 A4E30000 */  sh        $v1, 0x0($a3)
/* 166BB4 80246354 3C048025 */  lui       $a0, %hi(D_80249B88)
glabel .L80246358
/* 166BB8 80246358 8C849B88 */  lw        $a0, %lo(D_80249B88)($a0)
/* 166BBC 8024635C 00C0102D */  daddu     $v0, $a2, $zero
D_80246360:
/* 166BC0 80246360 3C018025 */  lui       $at, %hi(D_8024C098_C09918)
/* 166BC4 80246364 A022C098 */  sb        $v0, %lo(D_8024C098_C09918)($at)
glabel .L80246368
/* 166BC8 80246368 08091A38 */  j         .L802468E0
D_8024636C:
/* 166BCC 8024636C A0800004 */   sb       $zero, 0x4($a0)
D_80246370:
/* 166BD0 80246370 92630003 */  lbu       $v1, 0x3($s3)
/* 166BD4 80246374 24020006 */  addiu     $v0, $zero, 0x6
D_80246378:
/* 166BD8 80246378 14620018 */  bne       $v1, $v0, .L802463DC
/* 166BDC 8024637C 2C620004 */   sltiu    $v0, $v1, 0x4
D_80246380:
/* 166BE0 80246380 0C05272D */  jal       sfx_play_sound
/* 166BE4 80246384 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166BE8 80246388 A2600004 */  sb        $zero, 0x4($s3)
.L8024638C:
/* 166BEC 8024638C 3C058024 */  lui       $a1, %hi(func_802433F4)
D_80246390:
/* 166BF0 80246390 24A533F4 */  addiu     $a1, $a1, %lo(func_802433F4)
/* 166BF4 80246394 0C051F9F */  jal       set_window_update
D_80246398:
/* 166BF8 80246398 24040033 */   addiu    $a0, $zero, 0x33
D_8024639C:
/* 166BFC 8024639C 3C058024 */  lui       $a1, %hi(func_80243468)
D_802463A0:
/* 166C00 802463A0 24A53468 */  addiu     $a1, $a1, %lo(func_80243468)
/* 166C04 802463A4 0C051F9F */  jal       set_window_update
D_802463A8:
/* 166C08 802463A8 24040034 */   addiu    $a0, $zero, 0x34
/* 166C0C 802463AC 24040035 */  addiu     $a0, $zero, 0x35
D_802463B0:
/* 166C10 802463B0 3C108024 */  lui       $s0, %hi(D_802434DC)
/* 166C14 802463B4 261034DC */  addiu     $s0, $s0, %lo(D_802434DC)
glabel D_802463B8_kkj_19
/* 166C18 802463B8 0C051F9F */  jal       set_window_update
/* 166C1C 802463BC 0200282D */   daddu    $a1, $s0, $zero
D_802463C0:
/* 166C20 802463C0 24040037 */  addiu     $a0, $zero, 0x37
/* 166C24 802463C4 0C051F9F */  jal       set_window_update
D_802463C8:
/* 166C28 802463C8 0200282D */   daddu    $a1, $s0, $zero
/* 166C2C 802463CC 0260202D */  daddu     $a0, $s3, $zero
D_802463D0:
/* 166C30 802463D0 0000282D */  daddu     $a1, $zero, $zero
/* 166C34 802463D4 08091A38 */  j         .L802468E0
jtbl_802463D8:
/* 166C38 802463D8 24060001 */   addiu    $a2, $zero, 0x1
.L802463DC:
/* 166C3C 802463DC 10400142 */  beqz      $v0, .L802468E8
glabel func_802463E0
/* 166C40 802463E0 00000000 */   nop
.L802463E4:
/* 166C44 802463E4 92620003 */  lbu       $v0, 0x3($s3)
D_802463E8:
/* 166C48 802463E8 3C018007 */  lui       $at, %hi(gSaveSlotHasData)
/* 166C4C 802463EC 00220821 */  addu      $at, $at, $v0
/* 166C50 802463F0 90227A24 */  lbu       $v0, %lo(gSaveSlotHasData)($at)
/* 166C54 802463F4 1040001D */  beqz      $v0, .L8024646C
/* 166C58 802463F8 00000000 */   nop
/* 166C5C 802463FC 0C05272D */  jal       sfx_play_sound
/* 166C60 80246400 240400C9 */   addiu    $a0, $zero, 0xC9
/* 166C64 80246404 92630003 */  lbu       $v1, 0x3($s3)
/* 166C68 80246408 24020004 */  addiu     $v0, $zero, 0x4
/* 166C6C 8024640C A2620004 */  sb        $v0, 0x4($s3)
/* 166C70 80246410 3C018025 */  lui       $at, %hi(D_8024C094)
.L80246414:
/* 166C74 80246414 AC23C094 */  sw        $v1, %lo(D_8024C094)($at)
/* 166C78 80246418 08091A3A */  j         .L802468E8
.L8024641C:
/* 166C7C 8024641C 00000000 */   nop
/* 166C80 80246420 92630003 */  lbu       $v1, 0x3($s3)
D_80246424:
/* 166C84 80246424 24020006 */  addiu     $v0, $zero, 0x6
/* 166C88 80246428 14620009 */  bne       $v1, $v0, func_80246450
flo_08_D_802462C4_pad:
/* 166C8C 8024642C 2C620004 */   sltiu    $v0, $v1, 0x4

### DECOMPILED C INSTRUCTIONS:

void filemenu_main_handle_input(MenuPanel* menu) {
    s32 originalSelected = menu->selected;
    s32 i;

    if (filemenu_heldButtons & BUTTON_STICK_LEFT) {
        while (TRUE) {
            menu->col--;
            if (menu->col < 0) {
                menu->col = 0;
                break;
            }
            if (menu->selected != MENU_PANEL_SELECTED_GRID_DATA(menu)) {
                break;
            }
        }
    }

    if (filemenu_heldButtons & BUTTON_STICK_RIGHT) {
        while (TRUE) {
            menu->col++;
            if (menu->col >= menu->numCols) {
                menu->col = menu->numCols - 1;
                break;
            }

            if (menu->selected != MENU_PANEL_SELECTED_GRID_DATA(menu)) {
                break;
            }
        }
    }

    if (filemenu_heldButtons & BUTTON_STICK_UP) {
        menu->row--;
        if (menu->row < 0) {
            menu->row = 0;
        }
    }

    if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
        menu->row++;
        if (menu->row >= menu->numRows) {
            menu->row = menu->numRows - 1;
        }
    }

    switch (menu->page) {
        case 0:
            if (menu->col == 1 && (u8) menu->row < 2) {
                menu->col = 0;
            }
            break;
        case 1: // TODO required to duplicate cases 1-4 instead of using fallthrough
            if (menu->col == 1 && (u8) menu->row < 2) {
                menu->col = 0;
            }
            if (menu->row == 2) {
                menu->col = 1;
            }
            break;
        case 2:
            if (menu->col == 1 && (u8) menu->row < 2) {
                menu->col = 0;
            }
            if (menu->row == 2) {
                menu->col = 1;
            }
            break;
        case 3:
            if (menu->col == 1 && (u8) menu->row < 2) {
                menu->col = 0;
            }
            if (menu->row == 2) {
                menu->col = 1;
            }
            break;
        case 4:
            if (menu->col == 1 && (u8) menu->row < 2) {
                menu->col = 0;
            }
            if (menu->row == 2) {
                menu->col = 1;
            }
            break;
    }

    menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
    if (originalSelected != menu->selected) {
        sfx_play_sound(SOUND_2101);
    }

    if (menu->page == 0) {
        s32 originalOutputMode = gGameStatusPtr->soundOutputMode;

        if (filemenu_pressedButtons & BUTTON_Z) {
            gGameStatusPtr->soundOutputMode = SOUND_OUT_STEREO;
        }
        if (filemenu_pressedButtons & BUTTON_R) {
            gGameStatusPtr->soundOutputMode = SOUND_OUT_MONO;
        }

        if (originalOutputMode != gGameStatusPtr->soundOutputMode) {
            sfx_play_sound(SOUND_MENU_CHANGE_TAB);
            if (gGameStatusPtr->soundOutputMode != SOUND_OUT_MONO) {
                audio_set_stereo();
            } else {
                audio_set_mono();
            }
        }
    }

    if ((filemenu_pressedButtons & BUTTON_START) && menu->page == 0 && menu->selected < 4) {
        filemenu_pressedButtons = BUTTON_A;
    }

    if (filemenu_pressedButtons & BUTTON_A) {
        s32 cond = FALSE;

        switch (menu->page) {
            case 0:
                if (menu->selected < 4 && !gSaveSlotHasData[menu->selected]) {
                    cond = TRUE;
                }

                if (cond) {
                    MenuPanel* temp_a0;
                    for (i = 0; i < ARRAY_COUNT(filemenu_filename); i++) {
                        filemenu_filename[i] = 0xF7;
                    }
                    filemenu_filename_pos = 0;
                    set_window_update(WINDOW_ID_FILEMENU_CREATEFILE_HEADER, (s32)filemenu_update_show_name_input);
                    set_window_update(WINDOW_ID_FILEMENU_KEYBOARD, (s32)filemenu_update_show_name_input);
                    set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_hidden_with_rotation);
                    sfx_play_sound(SOUND_MENU_NEXT);
                    filemenu_currentMenu = 3;
                    temp_a0 = filemenu_menus[filemenu_currentMenu];
                    temp_a0->page = 0;
                    filemenu_set_selected(temp_a0, 0, 0);
                    break;
                }

                if (menu->selected == 6) {
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_hidden_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_hidden_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_hidden_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_hidden_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_hidden_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_hidden_title);
                    sfx_play_sound(SOUND_D6);
                    set_game_mode(GAME_MODE_END_FILE_SELECT);
                } else if (menu->selected == 4) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    menu->page = 1;
                    filemenu_set_selected(menu, 1, 2);
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_options_bottom);
                } else if (menu->selected == 5) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    menu->page = 3;
                    filemenu_set_selected(menu, 1, 2);
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_options_bottom);
                } else if (menu->selected < 4) {
                    MenuPanel* temp_a0;

                    sfx_play_sound(SOUND_MENU_NEXT);
                    set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_hidden_with_rotation);
                    set_window_update(menu->selected + WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_select_file);
                    sfx_play_sound(SOUND_MENU_NEXT);
                    set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, WINDOW_UPDATE_SHOW);

                    gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 143;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
                                        ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
                                        : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;

                    gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -29;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 192;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 25;
                    gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;

                    filemenu_currentMenu = 1;
                    temp_a0 = filemenu_menus[filemenu_currentMenu];
                    temp_a0->page = 4;
                    filemenu_set_selected(temp_a0, 0, 0);
                }
                break;
            case 1:
                if (menu->selected == 6) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    menu->page = 0;
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
                    filemenu_set_selected(menu, 0, 2);
                } else if (menu->selected < 4) {
                    if (gSaveSlotHasData[menu->selected]) {
                        MenuPanel* temp_a0;

                        sfx_play_sound(SOUND_MENU_NEXT);
                        set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_show_name_confirm);

                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 121;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;

                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -29;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 118;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 25;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;

                        filemenu_currentMenu = 1;
                        temp_a0 = filemenu_menus[filemenu_currentMenu];
                        temp_a0->page = 0;
                        filemenu_set_selected(temp_a0, 0, 1);
                    } else {
                        sfx_play_sound(SOUND_MENU_ERROR);
                    }
                }
                break;
            case 3:
                if (menu->selected == 6) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    menu->page = 0;
                    set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
                    set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
                    set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
                    filemenu_set_selected(menu, 0, 1);
                } else if (menu->selected < 4) {
                    if (gSaveSlotHasData[menu->selected]) {
                        sfx_play_sound(SOUND_MENU_NEXT);
                        menu->page = 4;
                        filemenu_loadedFileIdx = menu->selected;
                    } else {
                        sfx_play_sound(SOUND_MENU_ERROR);
                    }
                }
                break;
            case 4:
                if (menu->selected == 6) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    menu->page = 3;
                    filemenu_set_selected(menu, 0, 2);
                } else if (menu->selected < 4) {
                    if (filemenu_loadedFileIdx == menu->selected) {
                        sfx_play_sound(SOUND_MENU_ERROR);
                    } else {
                        filemenu_iterFileIdx = menu->selected;
                        if (!gSaveSlotHasData[menu->selected]) {
                            sfx_play_sound(SOUND_MENU_NEXT);
                            filemenu_currentMenu = 2;
                            filemenu_menus[filemenu_currentMenu]->page = 2;
                            gWindows[WINDOW_ID_FILEMENU_INFO].width = 154;
                            gWindows[WINDOW_ID_FILEMENU_INFO].height = 39;
                            gWindows[WINDOW_ID_FILEMENU_INFO].pos.x = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].width / 2;
                            gWindows[WINDOW_ID_FILEMENU_INFO].pos.y = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].height / 2)
                                         : SCREEN_HEIGHT / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].height / 2;

                            set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
                            set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, WINDOW_UPDATE_HIDE);
                            fio_load_game(filemenu_loadedFileIdx);
                            gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx];
                            fio_save_game(filemenu_iterFileIdx);
                            gSaveSlotHasData[filemenu_iterFileIdx] = TRUE;
                        } else {
                            MenuPanel* temp_a0;

                            sfx_play_sound(SOUND_MENU_NEXT);
                            set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_show_name_confirm);
                            gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 121;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;

                            gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -43;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 182;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 39;
                            gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;

                            filemenu_currentMenu = 1;
                            temp_a0 = filemenu_menus[filemenu_currentMenu];
                            temp_a0->page = 3;
                            filemenu_set_selected(temp_a0, 0, 1);
                        }
                    }
                }
                break;
            case 2:
                if (menu->selected == 6) {
                    sfx_play_sound(SOUND_MENU_NEXT);
                    set_game_mode(GAME_MODE_END_LANGUAGE_SELECT);
                } else if (menu->selected < 4) {
                    if (!gSaveSlotHasData[menu->selected]) {
                        sfx_play_sound(SOUND_MENU_NEXT);
                        filemenu_currentMenu = 2;
                        filemenu_menus[filemenu_currentMenu]->page = 1;
                        set_window_update(WINDOW_ID_FILEMENU_MAIN, (s32)main_menu_window_update);
                        set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
                        set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, WINDOW_UPDATE_HIDE);
                        fio_save_game(menu->selected);
                        gSaveSlotHasData[menu->selected] = TRUE;
                    } else {
                        MenuPanel* temp_a0;

                        sfx_play_sound(SOUND_MENU_NEXT);
                        set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_show_name_confirm);
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 127;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;

                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -50;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 148;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 38;
                        gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
                                         ? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
                                         : SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;

                        filemenu_currentMenu = 1;
                        temp_a0 = filemenu_menus[filemenu_currentMenu];
                        temp_a0->page = 1;
                        filemenu_set_selected(temp_a0, 0, 1);
                    }
                }
                break;
        }
    }

    if (filemenu_pressedButtons & BUTTON_B) {
        switch (menu->page) {
            case 0:
                filemenu_set_selected(menu, 2, 2);
                break;
            case 1:
                filemenu_set_selected(menu, 1, 2);
                break;
            case 2:
                filemenu_set_selected(menu, 1, 2);
                break;
            case 3:
                filemenu_set_selected(menu, 1, 2);
                break;
            case 4:
                filemenu_set_selected(menu, 1, 2);
                break;
        }

        switch (menu->page) {
            case 0:
                set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_hidden_options_left);
                set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_hidden_options_right);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_hidden_options_bottom);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_hidden_options_bottom);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_hidden_options_bottom);
                set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_hidden_options_left);
                set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_hidden_options_right);
                set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_hidden_options_left);
                set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_hidden_options_right);
                set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_hidden_title);
                sfx_play_sound(SOUND_D6);
                set_game_mode(GAME_MODE_END_FILE_SELECT);
                break;
            case 1:
                menu->page = 0;
                filemenu_set_selected(menu, 0, 2);
                set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
                set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
                sfx_play_sound(SOUND_MENU_BACK);
                break;
            case 3:
                menu->page = 0;
                filemenu_set_selected(menu, 1, 2);
                set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
                set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
                set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
                sfx_play_sound(SOUND_MENU_BACK);
                break;
            case 4:
                menu->page = 3;
                filemenu_set_selected(menu, (filemenu_loadedFileIdx % 2) * 2, filemenu_loadedFileIdx / 2);
                sfx_play_sound(SOUND_MENU_BACK);
                break;
            case 2:
                sfx_play_sound(SOUND_MENU_BACK);
                set_game_mode(GAME_MODE_END_LANGUAGE_SELECT);
                break;
        }
    }
}