### RAW ASSEMBLY INSTRUCTIONS:

glabel _show_message
/* F4CD0 802D0320 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* F4CD4 802D0324 AFB20038 */  sw        $s2, 0x38($sp)
/* F4CD8 802D0328 0080902D */  daddu     $s2, $a0, $zero
/* F4CDC 802D032C AFB50044 */  sw        $s5, 0x44($sp)
/* F4CE0 802D0330 0000A82D */  daddu     $s5, $zero, $zero
/* F4CE4 802D0334 AFB7004C */  sw        $s7, 0x4C($sp)
/* F4CE8 802D0338 AFB3003C */  sw        $s3, 0x3C($sp)
/* F4CEC 802D033C 3C138011 */  lui       $s3, %hi(gPlayerStatus)
/* F4CF0 802D0340 2673EFC8 */  addiu     $s3, $s3, %lo(gPlayerStatus)
/* F4CF4 802D0344 AFBF0054 */  sw        $ra, 0x54($sp)
/* F4CF8 802D0348 AFBE0050 */  sw        $fp, 0x50($sp)
/* F4CFC 802D034C AFB60048 */  sw        $s6, 0x48($sp)
/* F4D00 802D0350 AFB40040 */  sw        $s4, 0x40($sp)
/* F4D04 802D0354 AFB10034 */  sw        $s1, 0x34($sp)
/* F4D08 802D0358 AFB00030 */  sw        $s0, 0x30($sp)
/* F4D0C 802D035C F7B40058 */  sdc1      $f20, 0x58($sp)
/* F4D10 802D0360 8E50000C */  lw        $s0, 0xC($s2)
/* F4D14 802D0364 10A000CD */  beqz      $a1, .L802D069C
/* F4D18 802D0368 00C0B82D */   daddu    $s7, $a2, $zero
/* F4D1C 802D036C 3C16802E */  lui       $s6, %hi(D_802DB264)
/* F4D20 802D0370 26D6B264 */  addiu     $s6, $s6, %lo(D_802DB264)
/* F4D24 802D0374 AEC00000 */  sw        $zero, 0x0($s6)
/* F4D28 802D0378 8E050000 */  lw        $a1, 0x0($s0)
/* F4D2C 802D037C 0C0B1EAF */  jal       evt_get_variable
/* F4D30 802D0380 26100004 */   addiu    $s0, $s0, 0x4
/* F4D34 802D0384 8E050000 */  lw        $a1, 0x0($s0)
/* F4D38 802D0388 26100004 */  addiu     $s0, $s0, 0x4
/* F4D3C 802D038C 0240202D */  daddu     $a0, $s2, $zero
/* F4D40 802D0390 0C0B1EAF */  jal       evt_get_variable
/* F4D44 802D0394 0040F02D */   daddu    $fp, $v0, $zero
/* F4D48 802D0398 AE4200B8 */  sw        $v0, 0xB8($s2)
/* F4D4C 802D039C 8E050000 */  lw        $a1, 0x0($s0)
/* F4D50 802D03A0 26100004 */  addiu     $s0, $s0, 0x4
/* F4D54 802D03A4 0C0B1EAF */  jal       evt_get_variable
/* F4D58 802D03A8 0240202D */   daddu    $a0, $s2, $zero
/* F4D5C 802D03AC AE4200BC */  sw        $v0, 0xBC($s2)
/* F4D60 802D03B0 8E050000 */  lw        $a1, 0x0($s0)
/* F4D64 802D03B4 26100004 */  addiu     $s0, $s0, 0x4
/* F4D68 802D03B8 0C0B1EAF */  jal       evt_get_variable
/* F4D6C 802D03BC 0240202D */   daddu    $a0, $s2, $zero
/* F4D70 802D03C0 3C14802E */  lui       $s4, %hi(D_802DAE54)
/* F4D74 802D03C4 2694AE54 */  addiu     $s4, $s4, %lo(D_802DAE54)
/* F4D78 802D03C8 AE420074 */  sw        $v0, 0x74($s2)
/* F4D7C 802D03CC AE800000 */  sw        $zero, 0x0($s4)
/* F4D80 802D03D0 8E420074 */  lw        $v0, 0x74($s2)
/* F4D84 802D03D4 3C11802E */  lui       $s1, %hi(D_802DAE50)
/* F4D88 802D03D8 2631AE50 */  addiu     $s1, $s1, %lo(D_802DAE50)
/* F4D8C 802D03DC 30420100 */  andi      $v0, $v0, 0x100
/* F4D90 802D03E0 1040000B */  beqz      $v0, .L802D0410
/* F4D94 802D03E4 AE200000 */   sw       $zero, 0x0($s1)
/* F4D98 802D03E8 8E050000 */  lw        $a1, 0x0($s0)
/* F4D9C 802D03EC 26100004 */  addiu     $s0, $s0, 0x4
/* F4DA0 802D03F0 0C0B1EAF */  jal       evt_get_variable
/* F4DA4 802D03F4 0240202D */   daddu    $a0, $s2, $zero
/* F4DA8 802D03F8 AE220000 */  sw        $v0, 0x0($s1)
/* F4DAC 802D03FC 8E050000 */  lw        $a1, 0x0($s0)
/* F4DB0 802D0400 26100004 */  addiu     $s0, $s0, 0x4
/* F4DB4 802D0404 0C0B1EAF */  jal       evt_get_variable
/* F4DB8 802D0408 0240202D */   daddu    $a0, $s2, $zero
/* F4DBC 802D040C AE820000 */  sw        $v0, 0x0($s4)
.L802D0410:
/* F4DC0 802D0410 24020001 */  addiu     $v0, $zero, 0x1
/* F4DC4 802D0414 12E20012 */  beq       $s7, $v0, .L802D0460
/* F4DC8 802D0418 2AE20002 */   slti     $v0, $s7, 0x2
/* F4DCC 802D041C 10400005 */  beqz      $v0, .L802D0434
/* F4DD0 802D0420 24020002 */   addiu    $v0, $zero, 0x2
/* F4DD4 802D0424 12E00009 */  beqz      $s7, .L802D044C
/* F4DD8 802D0428 2402FFFE */   addiu    $v0, $zero, -0x2
/* F4DDC 802D042C 080B413A */  j         .L802D04E8
/* F4DE0 802D0430 00000000 */   nop
.L802D0434:
/* F4DE4 802D0434 12E20010 */  beq       $s7, $v0, .L802D0478
/* F4DE8 802D0438 24020003 */   addiu    $v0, $zero, 0x3
/* F4DEC 802D043C 12E20017 */  beq       $s7, $v0, .L802D049C
/* F4DF0 802D0440 2402FFFE */   addiu    $v0, $zero, -0x2
/* F4DF4 802D0444 080B413A */  j         .L802D04E8
/* F4DF8 802D0448 00000000 */   nop
.L802D044C:
/* F4DFC 802D044C 8E050000 */  lw        $a1, 0x0($s0)
/* F4E00 802D0450 0C0B1EAF */  jal       evt_get_variable
/* F4E04 802D0454 0240202D */   daddu    $a0, $s2, $zero
/* F4E08 802D0458 080B4135 */  j         .L802D04D4
/* F4E0C 802D045C 0040202D */   daddu    $a0, $v0, $zero
.L802D0460:
/* F4E10 802D0460 3C04802E */  lui       $a0, %hi(gCurrentPrintContext)
/* F4E14 802D0464 8C84B260 */  lw        $a0, %lo(gCurrentPrintContext)($a0)
/* F4E18 802D0468 0C04971C */  jal       close_message
/* F4E1C 802D046C 00000000 */   nop
/* F4E20 802D0470 080B413A */  j         .L802D04E8
/* F4E24 802D0474 2402FFFE */   addiu    $v0, $zero, -0x2
.L802D0478:
/* F4E28 802D0478 8E050000 */  lw        $a1, 0x0($s0)
/* F4E2C 802D047C 0C0B1EAF */  jal       evt_get_variable
/* F4E30 802D0480 0240202D */   daddu    $a0, $s2, $zero
/* F4E34 802D0484 3C05802E */  lui       $a1, %hi(gCurrentPrintContext)
/* F4E38 802D0488 8CA5B260 */  lw        $a1, %lo(gCurrentPrintContext)($a1)
/* F4E3C 802D048C 0C04969A */  jal       msg_printer_load_msg
/* F4E40 802D0490 0040202D */   daddu    $a0, $v0, $zero
/* F4E44 802D0494 080B413A */  j         .L802D04E8
/* F4E48 802D0498 2402FFFE */   addiu    $v0, $zero, -0x2
.L802D049C:
/* F4E4C 802D049C 8E050000 */  lw        $a1, 0x0($s0)
/* F4E50 802D04A0 26100004 */  addiu     $s0, $s0, 0x4
/* F4E54 802D04A4 0C0B1EAF */  jal       evt_get_variable
/* F4E58 802D04A8 0240202D */   daddu    $a0, $s2, $zero
/* F4E5C 802D04AC 0240202D */  daddu     $a0, $s2, $zero
/* F4E60 802D04B0 8E050000 */  lw        $a1, 0x0($s0)
/* F4E64 802D04B4 0C0B1EAF */  jal       evt_get_variable
/* F4E68 802D04B8 0040802D */   daddu    $s0, $v0, $zero
/* F4E6C 802D04BC 0240202D */  daddu     $a0, $s2, $zero
/* F4E70 802D04C0 0200282D */  daddu     $a1, $s0, $zero
/* F4E74 802D04C4 0C0B36B0 */  jal       resolve_npc
/* F4E78 802D04C8 0040802D */   daddu    $s0, $v0, $zero
/* F4E7C 802D04CC 0040A82D */  daddu     $s5, $v0, $zero
/* F4E80 802D04D0 0200202D */  daddu     $a0, $s0, $zero
.L802D04D4:
/* F4E84 802D04D4 0C049640 */  jal       msg_get_printer_for_msg
/* F4E88 802D04D8 02C0282D */   daddu    $a1, $s6, $zero
/* F4E8C 802D04DC 3C01802E */  lui       $at, %hi(gCurrentPrintContext)
/* F4E90 802D04E0 AC22B260 */  sw        $v0, %lo(gCurrentPrintContext)($at)
/* F4E94 802D04E4 2402FFFE */  addiu     $v0, $zero, -0x2
.L802D04E8:
/* F4E98 802D04E8 17C20018 */  bne       $fp, $v0, .L802D054C
/* F4E9C 802D04EC 0240202D */   daddu    $a0, $s2, $zero
/* F4EA0 802D04F0 8E650028 */  lw        $a1, 0x28($s3)
/* F4EA4 802D04F4 8E670030 */  lw        $a3, 0x30($s3)
/* F4EA8 802D04F8 27A20020 */  addiu     $v0, $sp, 0x20
/* F4EAC 802D04FC AFA20010 */  sw        $v0, 0x10($sp)
/* F4EB0 802D0500 27A20024 */  addiu     $v0, $sp, 0x24
/* F4EB4 802D0504 AFA20014 */  sw        $v0, 0x14($sp)
/* F4EB8 802D0508 866200B0 */  lh        $v0, 0xB0($s3)
/* F4EBC 802D050C C662002C */  lwc1      $f2, 0x2C($s3)
/* F4EC0 802D0510 44820000 */  mtc1      $v0, $f0
/* F4EC4 802D0514 00000000 */  nop
/* F4EC8 802D0518 46800020 */  cvt.s.w   $f0, $f0
/* F4ECC 802D051C 46001080 */  add.s     $f2, $f2, $f0
/* F4ED0 802D0520 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* F4ED4 802D0524 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* F4ED8 802D0528 44061000 */  mfc1      $a2, $f2
/* F4EDC 802D052C 27A20028 */  addiu     $v0, $sp, 0x28
/* F4EE0 802D0530 0C00B94E */  jal       get_screen_coords
/* F4EE4 802D0534 AFA20018 */   sw       $v0, 0x18($sp)
/* F4EE8 802D0538 8E6200B8 */  lw        $v0, 0xB8($s3)
/* F4EEC 802D053C AE42007C */  sw        $v0, 0x7C($s2)
/* F4EF0 802D0540 C6600080 */  lwc1      $f0, 0x80($s3)
/* F4EF4 802D0544 080B416C */  j         .L802D05B0
/* F4EF8 802D0548 2410FFFE */   addiu    $s0, $zero, -0x2
.L802D054C:
/* F4EFC 802D054C 0C0B36B0 */  jal       resolve_npc
/* F4F00 802D0550 03C0282D */   daddu    $a1, $fp, $zero
/* F4F04 802D0554 0040802D */  daddu     $s0, $v0, $zero
/* F4F08 802D0558 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* F4F0C 802D055C 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* F4F10 802D0560 860300A8 */  lh        $v1, 0xA8($s0)
/* F4F14 802D0564 C602003C */  lwc1      $f2, 0x3C($s0)
/* F4F18 802D0568 27A20020 */  addiu     $v0, $sp, 0x20
/* F4F1C 802D056C AFA20010 */  sw        $v0, 0x10($sp)
/* F4F20 802D0570 27A20024 */  addiu     $v0, $sp, 0x24
/* F4F24 802D0574 AFA20014 */  sw        $v0, 0x14($sp)
/* F4F28 802D0578 27A20028 */  addiu     $v0, $sp, 0x28
/* F4F2C 802D057C AFA20018 */  sw        $v0, 0x18($sp)
/* F4F30 802D0580 44830000 */  mtc1      $v1, $f0
/* F4F34 802D0584 00000000 */  nop
/* F4F38 802D0588 46800020 */  cvt.s.w   $f0, $f0
/* F4F3C 802D058C 46001080 */  add.s     $f2, $f2, $f0
/* F4F40 802D0590 8E050038 */  lw        $a1, 0x38($s0)
/* F4F44 802D0594 8E070040 */  lw        $a3, 0x40($s0)
/* F4F48 802D0598 44061000 */  mfc1      $a2, $f2
/* F4F4C 802D059C 0C00B94E */  jal       get_screen_coords
/* F4F50 802D05A0 00000000 */   nop
/* F4F54 802D05A4 8E020028 */  lw        $v0, 0x28($s0)
/* F4F58 802D05A8 AE42007C */  sw        $v0, 0x7C($s2)
/* F4F5C 802D05AC C600000C */  lwc1      $f0, 0xC($s0)
.L802D05B0:
/* F4F60 802D05B0 4600010D */  trunc.w.s $f4, $f0
/* F4F64 802D05B4 E64400C0 */  swc1      $f4, 0xC0($s2)
/* F4F68 802D05B8 3C04802E */  lui       $a0, %hi(gCurrentPrintContext)
/* F4F6C 802D05BC 8C84B260 */  lw        $a0, %lo(gCurrentPrintContext)($a0)
/* F4F70 802D05C0 8FA30020 */  lw        $v1, 0x20($sp)
/* F4F74 802D05C4 3C05802E */  lui       $a1, %hi(D_802DAE50)
/* F4F78 802D05C8 8CA5AE50 */  lw        $a1, %lo(D_802DAE50)($a1)
/* F4F7C 802D05CC 8FA20024 */  lw        $v0, 0x24($sp)
/* F4F80 802D05D0 3C06802E */  lui       $a2, %hi(D_802DAE54)
/* F4F84 802D05D4 8CC6AE54 */  lw        $a2, %lo(D_802DAE54)($a2)
/* F4F88 802D05D8 00652821 */  addu      $a1, $v1, $a1
/* F4F8C 802D05DC 0C0496AE */  jal       msg_printer_set_origin_pos
/* F4F90 802D05E0 00463021 */   addu     $a2, $v0, $a2
/* F4F94 802D05E4 2402FFFE */  addiu     $v0, $zero, -0x2
/* F4F98 802D05E8 1202002C */  beq       $s0, $v0, .L802D069C
/* F4F9C 802D05EC AE5000B4 */   sw       $s0, 0xB4($s2)
/* F4FA0 802D05F0 24020003 */  addiu     $v0, $zero, 0x3
/* F4FA4 802D05F4 16E20007 */  bne       $s7, $v0, .L802D0614
/* F4FA8 802D05F8 26710080 */   addiu    $s1, $s3, 0x80
/* F4FAC 802D05FC C60C0038 */  lwc1      $f12, 0x38($s0)
/* F4FB0 802D0600 C60E0040 */  lwc1      $f14, 0x40($s0)
/* F4FB4 802D0604 8EA60038 */  lw        $a2, 0x38($s5)
/* F4FB8 802D0608 8EA70040 */  lw        $a3, 0x40($s5)
/* F4FBC 802D060C 080B4189 */  j         .L802D0624
/* F4FC0 802D0610 26B1000C */   addiu    $s1, $s5, 0xC
.L802D0614:
/* F4FC4 802D0614 C60C0038 */  lwc1      $f12, 0x38($s0)
/* F4FC8 802D0618 C60E0040 */  lwc1      $f14, 0x40($s0)
/* F4FCC 802D061C 8E660028 */  lw        $a2, 0x28($s3)
/* F4FD0 802D0620 8E670030 */  lw        $a3, 0x30($s3)
.L802D0624:
/* F4FD4 802D0624 0C00A720 */  jal       atan2
/* F4FD8 802D0628 00000000 */   nop
/* F4FDC 802D062C 46000506 */  mov.s     $f20, $f0
/* F4FE0 802D0630 3C014334 */  lui       $at, (0x43340000 >> 16)
/* F4FE4 802D0634 44816000 */  mtc1      $at, $f12
/* F4FE8 802D0638 0C00A6C9 */  jal       clamp_angle
/* F4FEC 802D063C 460CA300 */   add.s    $f12, $f20, $f12
/* F4FF0 802D0640 8E420074 */  lw        $v0, 0x74($s2)
/* F4FF4 802D0644 3043000F */  andi      $v1, $v0, 0xF
/* F4FF8 802D0648 2C620006 */  sltiu     $v0, $v1, 0x6
/* F4FFC 802D064C 10400013 */  beqz      $v0, .L802D069C
/* F5000 802D0650 00031080 */   sll      $v0, $v1, 2
/* F5004 802D0654 3C01802E */  lui       $at, %hi(jtbl_802DA1F0)
/* F5008 802D0658 00220821 */  addu      $at, $at, $v0
/* F500C 802D065C 8C22A1F0 */  lw        $v0, %lo(jtbl_802DA1F0)($at)
/* F5010 802D0660 00400008 */  jr        $v0
/* F5014 802D0664 00000000 */   nop
glabel .L802D0668
/* F5018 802D0668 E614000C */  swc1      $f20, 0xC($s0)
/* F501C 802D066C 080B41A7 */  j         .L802D069C
/* F5020 802D0670 E6200000 */   swc1     $f0, 0x0($s1)
glabel .L802D0674
/* F5024 802D0674 E600000C */  swc1      $f0, 0xC($s0)
/* F5028 802D0678 080B41A7 */  j         .L802D069C
/* F502C 802D067C E6200000 */   swc1     $f0, 0x0($s1)
glabel .L802D0680
/* F5030 802D0680 E614000C */  swc1      $f20, 0xC($s0)
/* F5034 802D0684 080B41A7 */  j         .L802D069C
/* F5038 802D0688 E6340000 */   swc1     $f20, 0x0($s1)
glabel .L802D068C
/* F503C 802D068C E600000C */  swc1      $f0, 0xC($s0)
/* F5040 802D0690 080B41A7 */  j         .L802D069C
/* F5044 802D0694 E6340000 */   swc1     $f20, 0x0($s1)
glabel .L802D0698
/* F5048 802D0698 E614000C */  swc1      $f20, 0xC($s0)
glabel .L802D069C
/* F504C 802D069C 8E5000B4 */  lw        $s0, 0xB4($s2)
/* F5050 802D06A0 2402FFFE */  addiu     $v0, $zero, -0x2
/* F5054 802D06A4 12020022 */  beq       $s0, $v0, .L802D0730
/* F5058 802D06A8 27A20020 */   addiu    $v0, $sp, 0x20
/* F505C 802D06AC 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* F5060 802D06B0 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* F5064 802D06B4 860300A8 */  lh        $v1, 0xA8($s0)
/* F5068 802D06B8 C602003C */  lwc1      $f2, 0x3C($s0)
/* F506C 802D06BC AFA20010 */  sw        $v0, 0x10($sp)
/* F5070 802D06C0 27A20024 */  addiu     $v0, $sp, 0x24
/* F5074 802D06C4 AFA20014 */  sw        $v0, 0x14($sp)
/* F5078 802D06C8 27A20028 */  addiu     $v0, $sp, 0x28
/* F507C 802D06CC AFA20018 */  sw        $v0, 0x18($sp)
/* F5080 802D06D0 44830000 */  mtc1      $v1, $f0
/* F5084 802D06D4 00000000 */  nop
/* F5088 802D06D8 46800020 */  cvt.s.w   $f0, $f0
/* F508C 802D06DC 46001080 */  add.s     $f2, $f2, $f0
/* F5090 802D06E0 8E050038 */  lw        $a1, 0x38($s0)
/* F5094 802D06E4 8E070040 */  lw        $a3, 0x40($s0)
/* F5098 802D06E8 44061000 */  mfc1      $a2, $f2
/* F509C 802D06EC 0C00B94E */  jal       get_screen_coords
/* F50A0 802D06F0 00000000 */   nop
/* F50A4 802D06F4 8E4500B8 */  lw        $a1, 0xB8($s2)
/* F50A8 802D06F8 2402FFFF */  addiu     $v0, $zero, -0x1
/* F50AC 802D06FC 10A2002B */  beq       $a1, $v0, .L802D07AC
/* F50B0 802D0700 00000000 */   nop
/* F50B4 802D0704 3C02802E */  lui       $v0, %hi(gCurrentPrintContext)
/* F50B8 802D0708 8C42B260 */  lw        $v0, %lo(gCurrentPrintContext)($v0)
/* F50BC 802D070C 8C4204FC */  lw        $v0, 0x4FC($v0)
/* F50C0 802D0710 30420080 */  andi      $v0, $v0, 0x80
/* F50C4 802D0714 14400002 */  bnez      $v0, .L802D0720
/* F50C8 802D0718 00000000 */   nop
/* F50CC 802D071C 8E4500BC */  lw        $a1, 0xBC($s2)
.L802D0720:
/* F50D0 802D0720 0C0B36C3 */  jal       set_npc_animation
/* F50D4 802D0724 0200202D */   daddu    $a0, $s0, $zero
/* F50D8 802D0728 080B41EB */  j         .L802D07AC
/* F50DC 802D072C 00000000 */   nop
.L802D0730:
/* F50E0 802D0730 8E650028 */  lw        $a1, 0x28($s3)
/* F50E4 802D0734 8E670030 */  lw        $a3, 0x30($s3)
/* F50E8 802D0738 AFA20010 */  sw        $v0, 0x10($sp)
/* F50EC 802D073C 27A20024 */  addiu     $v0, $sp, 0x24
/* F50F0 802D0740 AFA20014 */  sw        $v0, 0x14($sp)
/* F50F4 802D0744 866200B0 */  lh        $v0, 0xB0($s3)
/* F50F8 802D0748 C662002C */  lwc1      $f2, 0x2C($s3)
/* F50FC 802D074C 44820000 */  mtc1      $v0, $f0
/* F5100 802D0750 00000000 */  nop
/* F5104 802D0754 46800020 */  cvt.s.w   $f0, $f0
/* F5108 802D0758 46001080 */  add.s     $f2, $f2, $f0
/* F510C 802D075C 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* F5110 802D0760 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* F5114 802D0764 44061000 */  mfc1      $a2, $f2
/* F5118 802D0768 27A20028 */  addiu     $v0, $sp, 0x28
/* F511C 802D076C 0C00B94E */  jal       get_screen_coords
/* F5120 802D0770 AFA20018 */   sw       $v0, 0x18($sp)
/* F5124 802D0774 8E4300B8 */  lw        $v1, 0xB8($s2)
/* F5128 802D0778 2402FFFF */  addiu     $v0, $zero, -0x1
/* F512C 802D077C 1062000B */  beq       $v1, $v0, .L802D07AC
/* F5130 802D0780 00000000 */   nop
/* F5134 802D0784 3C02802E */  lui       $v0, %hi(gCurrentPrintContext)
/* F5138 802D0788 8C42B260 */  lw        $v0, %lo(gCurrentPrintContext)($v0)
/* F513C 802D078C 8C4204FC */  lw        $v0, 0x4FC($v0)
/* F5140 802D0790 30420080 */  andi      $v0, $v0, 0x80
/* F5144 802D0794 10400003 */  beqz      $v0, .L802D07A4
/* F5148 802D0798 00000000 */   nop
/* F514C 802D079C 080B41EB */  j         .L802D07AC
/* F5150 802D07A0 AE6300B8 */   sw       $v1, 0xB8($s3)
.L802D07A4:
/* F5154 802D07A4 8E4200BC */  lw        $v0, 0xBC($s2)
/* F5158 802D07A8 AE6200B8 */  sw        $v0, 0xB8($s3)
.L802D07AC:
/* F515C 802D07AC 8E420074 */  lw        $v0, 0x74($s2)
/* F5160 802D07B0 30420200 */  andi      $v0, $v0, 0x200
/* F5164 802D07B4 1440000C */  bnez      $v0, .L802D07E8
/* F5168 802D07B8 00000000 */   nop
/* F516C 802D07BC 3C04802E */  lui       $a0, %hi(gCurrentPrintContext)
/* F5170 802D07C0 8C84B260 */  lw        $a0, %lo(gCurrentPrintContext)($a0)
/* F5174 802D07C4 8FA30020 */  lw        $v1, 0x20($sp)
/* F5178 802D07C8 3C05802E */  lui       $a1, %hi(D_802DAE50)
/* F517C 802D07CC 8CA5AE50 */  lw        $a1, %lo(D_802DAE50)($a1)
/* F5180 802D07D0 8FA20024 */  lw        $v0, 0x24($sp)
/* F5184 802D07D4 3C06802E */  lui       $a2, %hi(D_802DAE54)
/* F5188 802D07D8 8CC6AE54 */  lw        $a2, %lo(D_802DAE54)($a2)
/* F518C 802D07DC 00652821 */  addu      $a1, $v1, $a1
/* F5190 802D07E0 0C0496AE */  jal       msg_printer_set_origin_pos
/* F5194 802D07E4 00463021 */   addu     $a2, $v0, $a2
.L802D07E8:
/* F5198 802D07E8 3C02802E */  lui       $v0, %hi(gCurrentPrintContext)
/* F519C 802D07EC 8C42B260 */  lw        $v0, %lo(gCurrentPrintContext)($v0)
/* F51A0 802D07F0 8C4204FC */  lw        $v0, 0x4FC($v0)
/* F51A4 802D07F4 30420040 */  andi      $v0, $v0, 0x40
/* F51A8 802D07F8 14400019 */  bnez      $v0, .L802D0860
/* F51AC 802D07FC 24020001 */   addiu    $v0, $zero, 0x1
/* F51B0 802D0800 3C03802E */  lui       $v1, %hi(D_802DB264)
/* F51B4 802D0804 8C63B264 */  lw        $v1, %lo(D_802DB264)($v1)
/* F51B8 802D0808 14620015 */  bne       $v1, $v0, .L802D0860
/* F51BC 802D080C 0000102D */   daddu    $v0, $zero, $zero
/* F51C0 802D0810 8E4300B8 */  lw        $v1, 0xB8($s2)
/* F51C4 802D0814 2402FFFF */  addiu     $v0, $zero, -0x1
/* F51C8 802D0818 1062000A */  beq       $v1, $v0, .L802D0844
/* F51CC 802D081C 2402FFFE */   addiu    $v0, $zero, -0x2
/* F51D0 802D0820 12020006 */  beq       $s0, $v0, .L802D083C
/* F51D4 802D0824 00000000 */   nop
/* F51D8 802D0828 8E45007C */  lw        $a1, 0x7C($s2)
/* F51DC 802D082C 0C0B36C3 */  jal       set_npc_animation
/* F51E0 802D0830 0200202D */   daddu    $a0, $s0, $zero
/* F51E4 802D0834 080B4211 */  j         .L802D0844
/* F51E8 802D0838 00000000 */   nop
.L802D083C:
/* F51EC 802D083C 8E42007C */  lw        $v0, 0x7C($s2)
/* F51F0 802D0840 AE6200B8 */  sw        $v0, 0xB8($s3)
.L802D0844:
/* F51F4 802D0844 8E420074 */  lw        $v0, 0x74($s2)
/* F51F8 802D0848 30420010 */  andi      $v0, $v0, 0x10
/* F51FC 802D084C 10400004 */  beqz      $v0, .L802D0860
/* F5200 802D0850 24020001 */   addiu    $v0, $zero, 0x1
/* F5204 802D0854 C64000C0 */  lwc1      $f0, 0xC0($s2)
/* F5208 802D0858 46800020 */  cvt.s.w   $f0, $f0
/* F520C 802D085C E600000C */  swc1      $f0, 0xC($s0)
.L802D0860:
/* F5210 802D0860 8FBF0054 */  lw        $ra, 0x54($sp)
/* F5214 802D0864 8FBE0050 */  lw        $fp, 0x50($sp)
/* F5218 802D0868 8FB7004C */  lw        $s7, 0x4C($sp)
/* F521C 802D086C 8FB60048 */  lw        $s6, 0x48($sp)
/* F5220 802D0870 8FB50044 */  lw        $s5, 0x44($sp)
/* F5224 802D0874 8FB40040 */  lw        $s4, 0x40($sp)
/* F5228 802D0878 8FB3003C */  lw        $s3, 0x3C($sp)
/* F522C 802D087C 8FB20038 */  lw        $s2, 0x38($sp)
/* F5230 802D0880 8FB10034 */  lw        $s1, 0x34($sp)
/* F5234 802D0884 8FB00030 */  lw        $s0, 0x30($sp)
/* F5238 802D0888 D7B40058 */  ldc1      $f20, 0x58($sp)
/* F523C 802D088C 03E00008 */  jr        $ra
/* F5240 802D0890 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

s32 _show_message(Evt* script, s32 isInitialCall, s32 mode) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    Bytecode* args = script->ptrReadPos;
    s32 screenX, screenY, screenZ;
    Npc* speakerNpc;
    Npc* targetNpc;
    f32 reverseAngle;
    f32 angle;
    f32* listenerYaw;
    s32 speakerNpcID;
    s32 targetNpcID;
    s32 msgID;
    s32 animID;
    s32 ret;

    targetNpc = NULL;

    if (isInitialCall) {
        D_802DB264 = 0;
        speakerNpcID = evt_get_variable(script, *args++);
        script->varTable[13] = evt_get_variable(script, *args++);
        script->varTable[14] = evt_get_variable(script, *args++);
        script->functionTemp[1] = evt_get_variable(script, *args++);
        ShowMessageScreenOffsetY = 0;
        ShowMessageScreenOffsetX = 0;

        if (script->functionTemp[1] & SPEECH_FLAG_HAS_OFFSET) {
            ShowMessageScreenOffsetX = evt_get_variable(script, *args++);
            ShowMessageScreenOffsetY = evt_get_variable(script, *args++);
        }

        switch (mode) {
            case SHOW_MESSAGE_SPEAK_TO_PLAYER:
                msgID = evt_get_variable(script, *args++);
                gCurrentPrintContext = msg_get_printer_for_msg(msgID, &D_802DB264);
                break;
            case SHOW_MESSAGE_END_SPEECH:
                close_message(gCurrentPrintContext);
                break;
            case SHOW_MESSAGE_CONTINUE_SPEECH:
                msgID = evt_get_variable(script, *args++);
                msg_printer_load_msg(msgID, gCurrentPrintContext);
                break;
            case SHOW_MESSAGE_SPEAK_TO_NPC:
                targetNpcID = evt_get_variable(script, *args++);
                msgID = evt_get_variable(script, *args++);
                targetNpc = resolve_npc(script, targetNpcID);
                gCurrentPrintContext = msg_get_printer_for_msg(msgID, &D_802DB264);
                break;
        }

        if (speakerNpcID == NPC_PLAYER) {
            get_screen_coords(gCurrentCameraID, playerStatus->position.x,
                              playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z,
                              &screenX, &screenY, &screenZ);
            script->functionTemp[3] = playerStatus->anim;
            speakerNpc = (Npc*) NPC_PLAYER;
            script->varTable[15] = playerStatus->targetYaw;
        } else {
            speakerNpc = resolve_npc(script, speakerNpcID);
            get_screen_coords(gCurrentCameraID, speakerNpc->pos.x, speakerNpc->pos.y + speakerNpc->collisionHeight, speakerNpc->pos.z,
                              &screenX, &screenY, &screenZ);
            script->functionTemp[3] = speakerNpc->currentAnim;
            script->varTable[15] = speakerNpc->yaw;
        }

        msg_printer_set_origin_pos(gCurrentPrintContext,
            screenX + ShowMessageScreenOffsetX,
            screenY + ShowMessageScreenOffsetY);
        script->varTablePtr[12] = speakerNpc;

        if (speakerNpc != (Npc*) NPC_PLAYER) {
            if (mode == SHOW_MESSAGE_SPEAK_TO_NPC) {
                listenerYaw = &targetNpc->yaw;
                angle = atan2(speakerNpc->pos.x, speakerNpc->pos.z, targetNpc->pos.x, targetNpc->pos.z);
            } else {
                listenerYaw = &playerStatus->targetYaw;
                angle = atan2(speakerNpc->pos.x, speakerNpc->pos.z, playerStatus->position.x, playerStatus->position.z);
            }

            reverseAngle = clamp_angle(angle + 180.0f);
            switch (script->functionTemp[1] & SPEECH_ORIENTATION_MASK) {
                case SPEECH_FACE_EACH_OTHER:
                    speakerNpc->yaw = angle;
                    *listenerYaw = reverseAngle;
                    break;
                case SPEECH_FACE_LIKE_LISTENER:
                    speakerNpc->yaw = reverseAngle;
                    *listenerYaw = reverseAngle;
                    break;
                case SPEECH_FACE_LIKE_SPEAKER:
                    speakerNpc->yaw = angle;
                    *listenerYaw = angle;
                    break;
                case SPEECH_FACE_AWAY_FROM:
                    speakerNpc->yaw = reverseAngle;
                    *listenerYaw = angle;
                    break;
                case SPEECH_FACE_SPEAKER_ONLY:
                    speakerNpc->yaw = angle;
                    break;
                case 5:
                    break;
            }
        }
    }

    speakerNpc = script->varTablePtr[12];
    if (speakerNpc != (Npc*) NPC_PLAYER) {
        get_screen_coords(gCurrentCameraID, speakerNpc->pos.x, speakerNpc->pos.y + speakerNpc->collisionHeight, speakerNpc->pos.z, &screenX, &screenY, &screenZ);
        animID = script->varTable[13];
        if (animID != -1) {
            if (!(gCurrentPrintContext->stateFlags & MSG_STATE_FLAG_80)) {
                animID = script->varTable[14];
            }
            set_npc_animation(speakerNpc, animID);
        }
    } else {
        get_screen_coords(gCurrentCameraID, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, &screenX, &screenY, &screenZ);
        if (script->varTable[13] != -1) {
            if (gCurrentPrintContext->stateFlags & MSG_STATE_FLAG_80) {
                playerStatus->anim = script->varTable[13];
            } else {
                playerStatus->anim = script->varTable[14];
            }
        }
    }

    if (!(script->functionTemp[1] & SPEECH_FLAG_200)) {
        msg_printer_set_origin_pos(gCurrentPrintContext, screenX + ShowMessageScreenOffsetX, screenY + ShowMessageScreenOffsetY);
    }

    if (gCurrentPrintContext->stateFlags & MSG_STATE_FLAG_40) {
        return TRUE;
    }

    if (D_802DB264 != 1) {
        return FALSE;
    }

    if (script->varTable[13] != -1) {
        if (speakerNpc != (Npc*) NPC_PLAYER) {
            set_npc_animation(speakerNpc, script->functionTemp[3]);
        } else {
            playerStatus->anim = script->functionTemp[3];
        }
    }
    if (script->functionTemp[1] & SPEECH_FLAG_10) {
        speakerNpc->yaw = script->varTable[0xF];
    }
    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel msg_draw_char
/* C2A24 8012C324 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* C2A28 8012C328 00A0502D */  daddu     $t2, $a1, $zero
/* C2A2C 8012C32C AFB20008 */  sw        $s2, 0x8($sp)
/* C2A30 8012C330 00C0902D */  daddu     $s2, $a2, $zero
/* C2A34 8012C334 AFB10004 */  sw        $s1, 0x4($sp)
/* C2A38 8012C338 00E0882D */  daddu     $s1, $a3, $zero
/* C2A3C 8012C33C AFB40010 */  sw        $s4, 0x10($sp)
/* C2A40 8012C340 AFB3000C */  sw        $s3, 0xC($sp)
/* C2A44 8012C344 AFB00000 */  sw        $s0, 0x0($sp)
/* C2A48 8012C348 9542003C */  lhu       $v0, 0x3C($t2)
/* C2A4C 8012C34C C5460018 */  lwc1      $f6, 0x18($t2)
/* C2A50 8012C350 C542001C */  lwc1      $f2, 0x1C($t2)
/* C2A54 8012C354 8FA60028 */  lw        $a2, 0x28($sp)
/* C2A58 8012C358 00021080 */  sll       $v0, $v0, 2
/* C2A5C 8012C35C 3C09802F */  lui       $t1, %hi(gMsgCharsets)
/* C2A60 8012C360 01224821 */  addu      $t1, $t1, $v0
/* C2A64 8012C364 8D29B5A8 */  lw        $t1, %lo(gMsgCharsets)($t1)
/* C2A68 8012C368 8FA3002C */  lw        $v1, 0x2C($sp)
/* C2A6C 8012C36C 91220000 */  lbu       $v0, 0x0($t1)
/* C2A70 8012C370 8D4B0004 */  lw        $t3, 0x4($t2)
/* C2A74 8012C374 44822000 */  mtc1      $v0, $f4
/* C2A78 8012C378 00000000 */  nop
/* C2A7C 8012C37C 46802120 */  cvt.s.w   $f4, $f4
/* C2A80 8012C380 46043102 */  mul.s     $f4, $f6, $f4
/* C2A84 8012C384 00000000 */  nop
/* C2A88 8012C388 954C003E */  lhu       $t4, 0x3E($t2)
/* C2A8C 8012C38C 91220001 */  lbu       $v0, 0x1($t1)
/* C2A90 8012C390 8D470008 */  lw        $a3, 0x8($t2)
/* C2A94 8012C394 44820000 */  mtc1      $v0, $f0
/* C2A98 8012C398 00000000 */  nop
/* C2A9C 8012C39C 46800020 */  cvt.s.w   $f0, $f0
/* C2AA0 8012C3A0 46001082 */  mul.s     $f2, $f2, $f0
/* C2AA4 8012C3A4 00000000 */  nop
/* C2AA8 8012C3A8 8D48000C */  lw        $t0, 0xC($t2)
/* C2AAC 8012C3AC 8D450000 */  lw        $a1, 0x0($t2)
/* C2AB0 8012C3B0 4600220D */  trunc.w.s $f8, $f4
/* C2AB4 8012C3B4 44024000 */  mfc1      $v0, $f8
/* C2AB8 8012C3B8 00000000 */  nop
/* C2ABC 8012C3BC 00C26821 */  addu      $t5, $a2, $v0
/* C2AC0 8012C3C0 4600120D */  trunc.w.s $f8, $f2
/* C2AC4 8012C3C4 44024000 */  mfc1      $v0, $f8
/* C2AC8 8012C3C8 00000000 */  nop
/* C2ACC 8012C3CC 00627021 */  addu      $t6, $v1, $v0
/* C2AD0 8012C3D0 00CB102A */  slt       $v0, $a2, $t3
/* C2AD4 8012C3D4 1040016D */  beqz      $v0, .L8012C98C
/* C2AD8 8012C3D8 0068102A */   slt      $v0, $v1, $t0
/* C2ADC 8012C3DC 1040016B */  beqz      $v0, .L8012C98C
/* C2AE0 8012C3E0 00AD102A */   slt      $v0, $a1, $t5
/* C2AE4 8012C3E4 10400169 */  beqz      $v0, .L8012C98C
/* C2AE8 8012C3E8 00EE102A */   slt      $v0, $a3, $t6
/* C2AEC 8012C3EC 10400167 */  beqz      $v0, .L8012C98C
/* C2AF0 8012C3F0 00C5102A */   slt      $v0, $a2, $a1
/* C2AF4 8012C3F4 10400017 */  beqz      $v0, .L8012C454
/* C2AF8 8012C3F8 00C51023 */   subu     $v0, $a2, $a1
/* C2AFC 8012C3FC 04420001 */  bltzl     $v0, .L8012C404
/* C2B00 8012C400 00021023 */   negu     $v0, $v0
.L8012C404:
/* C2B04 8012C404 44820000 */  mtc1      $v0, $f0
/* C2B08 8012C408 00000000 */  nop
/* C2B0C 8012C40C 46800020 */  cvt.s.w   $f0, $f0
/* C2B10 8012C410 46060103 */  div.s     $f4, $f0, $f6
/* C2B14 8012C414 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* C2B18 8012C418 44811800 */  mtc1      $at, $f3
/* C2B1C 8012C41C 44801000 */  mtc1      $zero, $f2
/* C2B20 8012C420 46002021 */  cvt.d.s   $f0, $f4
/* C2B24 8012C424 46220000 */  add.d     $f0, $f0, $f2
/* C2B28 8012C428 3C014040 */  lui       $at, (0x40400000 >> 16)
/* C2B2C 8012C42C 44811800 */  mtc1      $at, $f3
/* C2B30 8012C430 44801000 */  mtc1      $zero, $f2
/* C2B34 8012C434 00000000 */  nop
/* C2B38 8012C438 46220002 */  mul.d     $f0, $f0, $f2
/* C2B3C 8012C43C 00000000 */  nop
/* C2B40 8012C440 46200020 */  cvt.s.d   $f0, $f0
/* C2B44 8012C444 4600020D */  trunc.w.s $f8, $f0
/* C2B48 8012C448 44104000 */  mfc1      $s0, $f8
/* C2B4C 8012C44C 0804B117 */  j         .L8012C45C
/* C2B50 8012C450 00A0C82D */   daddu    $t9, $a1, $zero
.L8012C454:
/* C2B54 8012C454 0000802D */  daddu     $s0, $zero, $zero
/* C2B58 8012C458 00C0C82D */  daddu     $t9, $a2, $zero
.L8012C45C:
/* C2B5C 8012C45C 0067102A */  slt       $v0, $v1, $a3
/* C2B60 8012C460 10400017 */  beqz      $v0, .L8012C4C0
/* C2B64 8012C464 0000C02D */   daddu    $t8, $zero, $zero
/* C2B68 8012C468 8C8204FC */  lw        $v0, 0x4FC($a0)
/* C2B6C 8012C46C 30420400 */  andi      $v0, $v0, 0x400
/* C2B70 8012C470 10400004 */  beqz      $v0, .L8012C484
/* C2B74 8012C474 00671023 */   subu     $v0, $v1, $a3
/* C2B78 8012C478 04610012 */  bgez      $v1, .L8012C4C4
/* C2B7C 8012C47C 0060782D */   daddu    $t7, $v1, $zero
/* C2B80 8012C480 00671023 */  subu      $v0, $v1, $a3
.L8012C484:
/* C2B84 8012C484 04420001 */  bltzl     $v0, .L8012C48C
/* C2B88 8012C488 00021023 */   negu     $v0, $v0
.L8012C48C:
/* C2B8C 8012C48C 44822000 */  mtc1      $v0, $f4
/* C2B90 8012C490 00000000 */  nop
/* C2B94 8012C494 46802120 */  cvt.s.w   $f4, $f4
/* C2B98 8012C498 C542001C */  lwc1      $f2, 0x1C($t2)
/* C2B9C 8012C49C 3C014200 */  lui       $at, (0x42000000 >> 16)
/* C2BA0 8012C4A0 44810000 */  mtc1      $at, $f0
/* C2BA4 8012C4A4 46022103 */  div.s     $f4, $f4, $f2
/* C2BA8 8012C4A8 46002002 */  mul.s     $f0, $f4, $f0
/* C2BAC 8012C4AC 00000000 */  nop
/* C2BB0 8012C4B0 4600020D */  trunc.w.s $f8, $f0
/* C2BB4 8012C4B4 44184000 */  mfc1      $t8, $f8
/* C2BB8 8012C4B8 0804B131 */  j         .L8012C4C4
/* C2BBC 8012C4BC 00E0782D */   daddu    $t7, $a3, $zero
.L8012C4C0:
/* C2BC0 8012C4C0 0060782D */  daddu     $t7, $v1, $zero
.L8012C4C4:
/* C2BC4 8012C4C4 01AB102A */  slt       $v0, $t5, $t3
/* C2BC8 8012C4C8 50400001 */  beql      $v0, $zero, .L8012C4D0
/* C2BCC 8012C4CC 0160682D */   daddu    $t5, $t3, $zero
.L8012C4D0:
/* C2BD0 8012C4D0 01C0582D */  daddu     $t3, $t6, $zero
/* C2BD4 8012C4D4 0168102A */  slt       $v0, $t3, $t0
/* C2BD8 8012C4D8 50400001 */  beql      $v0, $zero, .L8012C4E0
/* C2BDC 8012C4DC 0100582D */   daddu    $t3, $t0, $zero
.L8012C4E0:
/* C2BE0 8012C4E0 C5440018 */  lwc1      $f4, 0x18($t2)
/* C2BE4 8012C4E4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* C2BE8 8012C4E8 44811000 */  mtc1      $at, $f2
/* C2BEC 8012C4EC 3C014480 */  lui       $at, (0x44800000 >> 16)
/* C2BF0 8012C4F0 44813000 */  mtc1      $at, $f6
/* C2BF4 8012C4F4 46041103 */  div.s     $f4, $f2, $f4
/* C2BF8 8012C4F8 46062102 */  mul.s     $f4, $f4, $f6
/* C2BFC 8012C4FC 00000000 */  nop
/* C2C00 8012C500 C540001C */  lwc1      $f0, 0x1C($t2)
/* C2C04 8012C504 46001083 */  div.s     $f2, $f2, $f0
/* C2C08 8012C508 46061082 */  mul.s     $f2, $f2, $f6
/* C2C0C 8012C50C 00000000 */  nop
/* C2C10 8012C510 95440034 */  lhu       $a0, 0x34($t2)
/* C2C14 8012C514 30820011 */  andi      $v0, $a0, 0x11
/* C2C18 8012C518 4600220D */  trunc.w.s $f8, $f4
/* C2C1C 8012C51C 440E4000 */  mfc1      $t6, $f8
/* C2C20 8012C520 4600120D */  trunc.w.s $f8, $f2
/* C2C24 8012C524 44134000 */  mfc1      $s3, $f8
/* C2C28 8012C528 1040002C */  beqz      $v0, .L8012C5DC
/* C2C2C 8012C52C 3082FFEE */   andi     $v0, $a0, 0xFFEE
/* C2C30 8012C530 3C07F500 */  lui       $a3, (0xF5000100 >> 16)
/* C2C34 8012C534 34E70100 */  ori       $a3, $a3, (0xF5000100 & 0xFFFF)
/* C2C38 8012C538 3C080703 */  lui       $t0, (0x703C000 >> 16)
/* C2C3C 8012C53C 3508C000 */  ori       $t0, $t0, (0x703C000 & 0xFFFF)
/* C2C40 8012C540 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* C2C44 8012C544 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* C2C48 8012C548 8CA30000 */  lw        $v1, 0x0($a1)
/* C2C4C 8012C54C A5420034 */  sh        $v0, 0x34($t2)
/* C2C50 8012C550 3C02FD10 */  lui       $v0, (0xFD100000 >> 16)
/* C2C54 8012C554 3C04802F */  lui       $a0, %hi(D_802F4560)
/* C2C58 8012C558 24844560 */  addiu     $a0, $a0, %lo(D_802F4560)
/* C2C5C 8012C55C 0060302D */  daddu     $a2, $v1, $zero
/* C2C60 8012C560 24630008 */  addiu     $v1, $v1, 0x8
/* C2C64 8012C564 ACA30000 */  sw        $v1, 0x0($a1)
/* C2C68 8012C568 ACC20000 */  sw        $v0, 0x0($a2)
/* C2C6C 8012C56C 00111100 */  sll       $v0, $s1, 4
/* C2C70 8012C570 00441021 */  addu      $v0, $v0, $a0
/* C2C74 8012C574 ACC20004 */  sw        $v0, 0x4($a2)
/* C2C78 8012C578 24620008 */  addiu     $v0, $v1, 0x8
/* C2C7C 8012C57C ACA20000 */  sw        $v0, 0x0($a1)
/* C2C80 8012C580 3C02E800 */  lui       $v0, (0xE8000000 >> 16)
/* C2C84 8012C584 AC620000 */  sw        $v0, 0x0($v1)
/* C2C88 8012C588 24620010 */  addiu     $v0, $v1, 0x10
/* C2C8C 8012C58C AC600004 */  sw        $zero, 0x4($v1)
/* C2C90 8012C590 ACA20000 */  sw        $v0, 0x0($a1)
/* C2C94 8012C594 3C020700 */  lui       $v0, (0x7000000 >> 16)
/* C2C98 8012C598 AC62000C */  sw        $v0, 0xC($v1)
/* C2C9C 8012C59C 24620018 */  addiu     $v0, $v1, 0x18
/* C2CA0 8012C5A0 AC670008 */  sw        $a3, 0x8($v1)
/* C2CA4 8012C5A4 ACA20000 */  sw        $v0, 0x0($a1)
/* C2CA8 8012C5A8 3C02E600 */  lui       $v0, (0xE6000000 >> 16)
/* C2CAC 8012C5AC AC620010 */  sw        $v0, 0x10($v1)
/* C2CB0 8012C5B0 24620020 */  addiu     $v0, $v1, 0x20
/* C2CB4 8012C5B4 AC600014 */  sw        $zero, 0x14($v1)
/* C2CB8 8012C5B8 ACA20000 */  sw        $v0, 0x0($a1)
/* C2CBC 8012C5BC 3C02F000 */  lui       $v0, (0xF0000000 >> 16)
/* C2CC0 8012C5C0 AC620018 */  sw        $v0, 0x18($v1)
/* C2CC4 8012C5C4 24620028 */  addiu     $v0, $v1, 0x28
/* C2CC8 8012C5C8 AC68001C */  sw        $t0, 0x1C($v1)
/* C2CCC 8012C5CC ACA20000 */  sw        $v0, 0x0($a1)
/* C2CD0 8012C5D0 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* C2CD4 8012C5D4 AC620020 */  sw        $v0, 0x20($v1)
/* C2CD8 8012C5D8 AC600024 */  sw        $zero, 0x24($v1)
.L8012C5DC:
/* C2CDC 8012C5DC 91220000 */  lbu       $v0, 0x0($t1)
/* C2CE0 8012C5E0 2C420010 */  sltiu     $v0, $v0, 0x10
/* C2CE4 8012C5E4 1440006B */  bnez      $v0, .L8012C794
/* C2CE8 8012C5E8 00000000 */   nop
/* C2CEC 8012C5EC 91220000 */  lbu       $v0, 0x0($t1)
/* C2CF0 8012C5F0 3042000F */  andi      $v0, $v0, 0xF
/* C2CF4 8012C5F4 14400067 */  bnez      $v0, .L8012C794
/* C2CF8 8012C5F8 3C02FD50 */   lui      $v0, (0xFD500000 >> 16)
/* C2CFC 8012C5FC 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* C2D00 8012C600 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* C2D04 8012C604 8CC40000 */  lw        $a0, 0x0($a2)
/* C2D08 8012C608 0080382D */  daddu     $a3, $a0, $zero
/* C2D0C 8012C60C 24840008 */  addiu     $a0, $a0, 0x8
/* C2D10 8012C610 ACC40000 */  sw        $a0, 0x0($a2)
/* C2D14 8012C614 ACE20000 */  sw        $v0, 0x0($a3)
/* C2D18 8012C618 24820008 */  addiu     $v0, $a0, 0x8
/* C2D1C 8012C61C ACC20000 */  sw        $v0, 0x0($a2)
/* C2D20 8012C620 24820010 */  addiu     $v0, $a0, 0x10
/* C2D24 8012C624 ACC20000 */  sw        $v0, 0x0($a2)
/* C2D28 8012C628 000C1040 */  sll       $v0, $t4, 1
/* C2D2C 8012C62C 004C1021 */  addu      $v0, $v0, $t4
/* C2D30 8012C630 00021080 */  sll       $v0, $v0, 2
/* C2D34 8012C634 8D250008 */  lw        $a1, 0x8($t1)
/* C2D38 8012C638 95230004 */  lhu       $v1, 0x4($t1)
/* C2D3C 8012C63C 00451021 */  addu      $v0, $v0, $a1
/* C2D40 8012C640 00720018 */  mult      $v1, $s2
/* C2D44 8012C644 24830018 */  addiu     $v1, $a0, 0x18
/* C2D48 8012C648 8C420000 */  lw        $v0, 0x0($v0)
/* C2D4C 8012C64C 3C050700 */  lui       $a1, (0x7000000 >> 16)
/* C2D50 8012C650 ACC30000 */  sw        $v1, 0x0($a2)
/* C2D54 8012C654 0000A012 */  mflo      $s4
/* C2D58 8012C658 00541021 */  addu      $v0, $v0, $s4
/* C2D5C 8012C65C ACE20004 */  sw        $v0, 0x4($a3)
/* C2D60 8012C660 3C02F550 */  lui       $v0, (0xF5500000 >> 16)
/* C2D64 8012C664 AC820000 */  sw        $v0, 0x0($a0)
/* C2D68 8012C668 3C02E600 */  lui       $v0, (0xE6000000 >> 16)
/* C2D6C 8012C66C AC820008 */  sw        $v0, 0x8($a0)
/* C2D70 8012C670 3C02F300 */  lui       $v0, (0xF3000000 >> 16)
/* C2D74 8012C674 AC850004 */  sw        $a1, 0x4($a0)
/* C2D78 8012C678 AC80000C */  sw        $zero, 0xC($a0)
/* C2D7C 8012C67C AC820010 */  sw        $v0, 0x10($a0)
/* C2D80 8012C680 91230000 */  lbu       $v1, 0x0($t1)
/* C2D84 8012C684 24860014 */  addiu     $a2, $a0, 0x14
/* C2D88 8012C688 00032102 */  srl       $a0, $v1, 4
/* C2D8C 8012C68C 10800002 */  beqz      $a0, .L8012C698
/* C2D90 8012C690 24080800 */   addiu    $t0, $zero, 0x800
/* C2D94 8012C694 248807FF */  addiu     $t0, $a0, 0x7FF
.L8012C698:
/* C2D98 8012C698 91220001 */  lbu       $v0, 0x1($t1)
/* C2D9C 8012C69C 00620018 */  mult      $v1, $v0
/* C2DA0 8012C6A0 0000A012 */  mflo      $s4
/* C2DA4 8012C6A4 26820003 */  addiu     $v0, $s4, 0x3
/* C2DA8 8012C6A8 00021083 */  sra       $v0, $v0, 2
/* C2DAC 8012C6AC 2443FFFF */  addiu     $v1, $v0, -0x1
/* C2DB0 8012C6B0 28620800 */  slti      $v0, $v1, 0x800
/* C2DB4 8012C6B4 50400001 */  beql      $v0, $zero, .L8012C6BC
/* C2DB8 8012C6B8 240307FF */   addiu    $v1, $zero, 0x7FF
.L8012C6BC:
/* C2DBC 8012C6BC 30620FFF */  andi      $v0, $v1, 0xFFF
/* C2DC0 8012C6C0 00021300 */  sll       $v0, $v0, 12
/* C2DC4 8012C6C4 1080000D */  beqz      $a0, .L8012C6FC
/* C2DC8 8012C6C8 00452825 */   or       $a1, $v0, $a1
/* C2DCC 8012C6CC 14800002 */  bnez      $a0, .L8012C6D8
/* C2DD0 8012C6D0 0104001A */   div      $zero, $t0, $a0
/* C2DD4 8012C6D4 0007000D */  break     7
.L8012C6D8:
/* C2DD8 8012C6D8 2401FFFF */  addiu     $at, $zero, -0x1
/* C2DDC 8012C6DC 14810004 */  bne       $a0, $at, .L8012C6F0
/* C2DE0 8012C6E0 3C018000 */   lui      $at, (0x80000000 >> 16)
/* C2DE4 8012C6E4 15010002 */  bne       $t0, $at, .L8012C6F0
/* C2DE8 8012C6E8 00000000 */   nop
/* C2DEC 8012C6EC 0006000D */  break     6
.L8012C6F0:
/* C2DF0 8012C6F0 00001012 */  mflo      $v0
/* C2DF4 8012C6F4 0804B1C0 */  j         .L8012C700
/* C2DF8 8012C6F8 00A21025 */   or       $v0, $a1, $v0
.L8012C6FC:
/* C2DFC 8012C6FC 00A81025 */  or        $v0, $a1, $t0
.L8012C700:
/* C2E00 8012C700 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* C2E04 8012C704 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* C2E08 8012C708 8CA40000 */  lw        $a0, 0x0($a1)
/* C2E0C 8012C70C ACC20000 */  sw        $v0, 0x0($a2)
/* C2E10 8012C710 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* C2E14 8012C714 0080182D */  daddu     $v1, $a0, $zero
/* C2E18 8012C718 24840008 */  addiu     $a0, $a0, 0x8
/* C2E1C 8012C71C ACA40000 */  sw        $a0, 0x0($a1)
/* C2E20 8012C720 AC620000 */  sw        $v0, 0x0($v1)
/* C2E24 8012C724 24820008 */  addiu     $v0, $a0, 0x8
/* C2E28 8012C728 AC600004 */  sw        $zero, 0x4($v1)
/* C2E2C 8012C72C ACA20000 */  sw        $v0, 0x0($a1)
/* C2E30 8012C730 91220000 */  lbu       $v0, 0x0($t1)
/* C2E34 8012C734 24830010 */  addiu     $v1, $a0, 0x10
/* C2E38 8012C738 AC800004 */  sw        $zero, 0x4($a0)
/* C2E3C 8012C73C ACA30000 */  sw        $v1, 0x0($a1)
/* C2E40 8012C740 3C03F200 */  lui       $v1, (0xF2000000 >> 16)
/* C2E44 8012C744 AC830008 */  sw        $v1, 0x8($a0)
/* C2E48 8012C748 3C03F540 */  lui       $v1, (0xF5400000 >> 16)
/* C2E4C 8012C74C 00021042 */  srl       $v0, $v0, 1
/* C2E50 8012C750 24420007 */  addiu     $v0, $v0, 0x7
/* C2E54 8012C754 000210C2 */  srl       $v0, $v0, 3
/* C2E58 8012C758 00021240 */  sll       $v0, $v0, 9
/* C2E5C 8012C75C 00431025 */  or        $v0, $v0, $v1
/* C2E60 8012C760 AC820000 */  sw        $v0, 0x0($a0)
/* C2E64 8012C764 91230000 */  lbu       $v1, 0x0($t1)
/* C2E68 8012C768 91220001 */  lbu       $v0, 0x1($t1)
/* C2E6C 8012C76C 2463FFFF */  addiu     $v1, $v1, -0x1
/* C2E70 8012C770 00031880 */  sll       $v1, $v1, 2
/* C2E74 8012C774 30630FFF */  andi      $v1, $v1, 0xFFF
/* C2E78 8012C778 00031B00 */  sll       $v1, $v1, 12
/* C2E7C 8012C77C 2442FFFF */  addiu     $v0, $v0, -0x1
/* C2E80 8012C780 00021080 */  sll       $v0, $v0, 2
/* C2E84 8012C784 30420FFF */  andi      $v0, $v0, 0xFFF
/* C2E88 8012C788 00621825 */  or        $v1, $v1, $v0
/* C2E8C 8012C78C 0804B23D */  j         .L8012C8F4
/* C2E90 8012C790 AC83000C */   sw       $v1, 0xC($a0)
.L8012C794:
/* C2E94 8012C794 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* C2E98 8012C798 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* C2E9C 8012C79C 8CC50000 */  lw        $a1, 0x0($a2)
/* C2EA0 8012C7A0 00A0382D */  daddu     $a3, $a1, $zero
/* C2EA4 8012C7A4 24A50008 */  addiu     $a1, $a1, 0x8
/* C2EA8 8012C7A8 ACC50000 */  sw        $a1, 0x0($a2)
/* C2EAC 8012C7AC 91220000 */  lbu       $v0, 0x0($t1)
/* C2EB0 8012C7B0 3C03FD48 */  lui       $v1, (0xFD480000 >> 16)
/* C2EB4 8012C7B4 00021042 */  srl       $v0, $v0, 1
/* C2EB8 8012C7B8 2442FFFF */  addiu     $v0, $v0, -0x1
/* C2EBC 8012C7BC 30420FFF */  andi      $v0, $v0, 0xFFF
/* C2EC0 8012C7C0 00431025 */  or        $v0, $v0, $v1
/* C2EC4 8012C7C4 ACE20000 */  sw        $v0, 0x0($a3)
/* C2EC8 8012C7C8 000C1040 */  sll       $v0, $t4, 1
/* C2ECC 8012C7CC 004C1021 */  addu      $v0, $v0, $t4
/* C2ED0 8012C7D0 00021080 */  sll       $v0, $v0, 2
/* C2ED4 8012C7D4 8D240008 */  lw        $a0, 0x8($t1)
/* C2ED8 8012C7D8 95230004 */  lhu       $v1, 0x4($t1)
/* C2EDC 8012C7DC 00441021 */  addu      $v0, $v0, $a0
/* C2EE0 8012C7E0 00720018 */  mult      $v1, $s2
/* C2EE4 8012C7E4 8C420000 */  lw        $v0, 0x0($v0)
/* C2EE8 8012C7E8 24A30008 */  addiu     $v1, $a1, 0x8
/* C2EEC 8012C7EC ACC30000 */  sw        $v1, 0x0($a2)
/* C2EF0 8012C7F0 24A30010 */  addiu     $v1, $a1, 0x10
/* C2EF4 8012C7F4 0000A012 */  mflo      $s4
/* C2EF8 8012C7F8 00541021 */  addu      $v0, $v0, $s4
/* C2EFC 8012C7FC ACE20004 */  sw        $v0, 0x4($a3)
/* C2F00 8012C800 91220000 */  lbu       $v0, 0x0($t1)
/* C2F04 8012C804 3C070700 */  lui       $a3, (0x7000000 >> 16)
/* C2F08 8012C808 ACA70004 */  sw        $a3, 0x4($a1)
/* C2F0C 8012C80C ACC30000 */  sw        $v1, 0x0($a2)
/* C2F10 8012C810 3C03E600 */  lui       $v1, (0xE6000000 >> 16)
/* C2F14 8012C814 ACA30008 */  sw        $v1, 0x8($a1)
/* C2F18 8012C818 24A30018 */  addiu     $v1, $a1, 0x18
/* C2F1C 8012C81C ACA0000C */  sw        $zero, 0xC($a1)
/* C2F20 8012C820 ACC30000 */  sw        $v1, 0x0($a2)
/* C2F24 8012C824 3C03F400 */  lui       $v1, (0xF4000000 >> 16)
/* C2F28 8012C828 ACA30010 */  sw        $v1, 0x10($a1)
/* C2F2C 8012C82C 3C03F548 */  lui       $v1, (0xF5480000 >> 16)
/* C2F30 8012C830 00021042 */  srl       $v0, $v0, 1
/* C2F34 8012C834 24420007 */  addiu     $v0, $v0, 0x7
/* C2F38 8012C838 000210C2 */  srl       $v0, $v0, 3
/* C2F3C 8012C83C 00021240 */  sll       $v0, $v0, 9
/* C2F40 8012C840 00431025 */  or        $v0, $v0, $v1
/* C2F44 8012C844 ACA20000 */  sw        $v0, 0x0($a1)
/* C2F48 8012C848 91220000 */  lbu       $v0, 0x0($t1)
/* C2F4C 8012C84C 91240001 */  lbu       $a0, 0x1($t1)
/* C2F50 8012C850 24A30020 */  addiu     $v1, $a1, 0x20
/* C2F54 8012C854 ACC30000 */  sw        $v1, 0x0($a2)
/* C2F58 8012C858 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* C2F5C 8012C85C ACA30018 */  sw        $v1, 0x18($a1)
/* C2F60 8012C860 24A30028 */  addiu     $v1, $a1, 0x28
/* C2F64 8012C864 ACA0001C */  sw        $zero, 0x1C($a1)
/* C2F68 8012C868 ACC30000 */  sw        $v1, 0x0($a2)
/* C2F6C 8012C86C 2442FFFF */  addiu     $v0, $v0, -0x1
/* C2F70 8012C870 00021040 */  sll       $v0, $v0, 1
/* C2F74 8012C874 30420FFF */  andi      $v0, $v0, 0xFFF
/* C2F78 8012C878 00021300 */  sll       $v0, $v0, 12
/* C2F7C 8012C87C 2484FFFF */  addiu     $a0, $a0, -0x1
/* C2F80 8012C880 00042080 */  sll       $a0, $a0, 2
/* C2F84 8012C884 30840FFF */  andi      $a0, $a0, 0xFFF
/* C2F88 8012C888 00872025 */  or        $a0, $a0, $a3
/* C2F8C 8012C88C 00441025 */  or        $v0, $v0, $a0
/* C2F90 8012C890 ACA20014 */  sw        $v0, 0x14($a1)
/* C2F94 8012C894 91220000 */  lbu       $v0, 0x0($t1)
/* C2F98 8012C898 24A30030 */  addiu     $v1, $a1, 0x30
/* C2F9C 8012C89C ACA00024 */  sw        $zero, 0x24($a1)
/* C2FA0 8012C8A0 ACC30000 */  sw        $v1, 0x0($a2)
/* C2FA4 8012C8A4 3C03F200 */  lui       $v1, (0xF2000000 >> 16)
/* C2FA8 8012C8A8 ACA30028 */  sw        $v1, 0x28($a1)
/* C2FAC 8012C8AC 3C03F540 */  lui       $v1, (0xF5400000 >> 16)
/* C2FB0 8012C8B0 00021042 */  srl       $v0, $v0, 1
/* C2FB4 8012C8B4 24420007 */  addiu     $v0, $v0, 0x7
/* C2FB8 8012C8B8 000210C2 */  srl       $v0, $v0, 3
/* C2FBC 8012C8BC 00021240 */  sll       $v0, $v0, 9
/* C2FC0 8012C8C0 00431025 */  or        $v0, $v0, $v1
/* C2FC4 8012C8C4 ACA20020 */  sw        $v0, 0x20($a1)
/* C2FC8 8012C8C8 91230000 */  lbu       $v1, 0x0($t1)
/* C2FCC 8012C8CC 91220001 */  lbu       $v0, 0x1($t1)
/* C2FD0 8012C8D0 2463FFFF */  addiu     $v1, $v1, -0x1
/* C2FD4 8012C8D4 00031880 */  sll       $v1, $v1, 2
/* C2FD8 8012C8D8 30630FFF */  andi      $v1, $v1, 0xFFF
/* C2FDC 8012C8DC 00031B00 */  sll       $v1, $v1, 12
/* C2FE0 8012C8E0 2442FFFF */  addiu     $v0, $v0, -0x1
/* C2FE4 8012C8E4 00021080 */  sll       $v0, $v0, 2
/* C2FE8 8012C8E8 30420FFF */  andi      $v0, $v0, 0xFFF
/* C2FEC 8012C8EC 00621825 */  or        $v1, $v1, $v0
/* C2FF0 8012C8F0 ACA3002C */  sw        $v1, 0x2C($a1)
.L8012C8F4:
/* C2FF4 8012C8F4 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* C2FF8 8012C8F8 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* C2FFC 8012C8FC 000D1080 */  sll       $v0, $t5, 2
/* C3000 8012C900 30420FFF */  andi      $v0, $v0, 0xFFF
/* C3004 8012C904 00021300 */  sll       $v0, $v0, 12
/* C3008 8012C908 000B1880 */  sll       $v1, $t3, 2
/* C300C 8012C90C 30630FFF */  andi      $v1, $v1, 0xFFF
/* C3010 8012C910 3C04E400 */  lui       $a0, (0xE4000000 >> 16)
/* C3014 8012C914 00641825 */  or        $v1, $v1, $a0
/* C3018 8012C918 00431025 */  or        $v0, $v0, $v1
/* C301C 8012C91C 000F1880 */  sll       $v1, $t7, 2
/* C3020 8012C920 8CC50000 */  lw        $a1, 0x0($a2)
/* C3024 8012C924 30630FFF */  andi      $v1, $v1, 0xFFF
/* C3028 8012C928 00A0382D */  daddu     $a3, $a1, $zero
/* C302C 8012C92C 24A50008 */  addiu     $a1, $a1, 0x8
/* C3030 8012C930 ACC50000 */  sw        $a1, 0x0($a2)
/* C3034 8012C934 ACE20000 */  sw        $v0, 0x0($a3)
/* C3038 8012C938 00191080 */  sll       $v0, $t9, 2
/* C303C 8012C93C 30420FFF */  andi      $v0, $v0, 0xFFF
/* C3040 8012C940 00021300 */  sll       $v0, $v0, 12
/* C3044 8012C944 00431025 */  or        $v0, $v0, $v1
/* C3048 8012C948 ACE20004 */  sw        $v0, 0x4($a3)
/* C304C 8012C94C 24A20008 */  addiu     $v0, $a1, 0x8
/* C3050 8012C950 ACC20000 */  sw        $v0, 0x0($a2)
/* C3054 8012C954 3C02E100 */  lui       $v0, (0xE1000000 >> 16)
/* C3058 8012C958 ACA20000 */  sw        $v0, 0x0($a1)
/* C305C 8012C95C 00101400 */  sll       $v0, $s0, 16
/* C3060 8012C960 3303FFFF */  andi      $v1, $t8, 0xFFFF
/* C3064 8012C964 00431025 */  or        $v0, $v0, $v1
/* C3068 8012C968 ACA20004 */  sw        $v0, 0x4($a1)
/* C306C 8012C96C 24A20010 */  addiu     $v0, $a1, 0x10
/* C3070 8012C970 ACC20000 */  sw        $v0, 0x0($a2)
/* C3074 8012C974 3C02F100 */  lui       $v0, (0xF1000000 >> 16)
/* C3078 8012C978 ACA20008 */  sw        $v0, 0x8($a1)
/* C307C 8012C97C 000E1400 */  sll       $v0, $t6, 16
/* C3080 8012C980 3263FFFF */  andi      $v1, $s3, 0xFFFF
/* C3084 8012C984 00431025 */  or        $v0, $v0, $v1
/* C3088 8012C988 ACA2000C */  sw        $v0, 0xC($a1)
.L8012C98C:
/* C308C 8012C98C 8FB40010 */  lw        $s4, 0x10($sp)
/* C3090 8012C990 8FB3000C */  lw        $s3, 0xC($sp)
/* C3094 8012C994 8FB20008 */  lw        $s2, 0x8($sp)
/* C3098 8012C998 8FB10004 */  lw        $s1, 0x4($sp)
/* C309C 8012C99C 8FB00000 */  lw        $s0, 0x0($sp)
/* C30A0 8012C9A0 03E00008 */  jr        $ra
/* C30A4 8012C9A4 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void msg_draw_char(MessagePrintState* printer, MessageDrawState* drawState, s32 charIndex, s32 palette, s32 posX, s32 posY) {
    MessageCharset* messageCharset = gMsgCharsets[drawState->font];
    s32 fontVariant = drawState->fontVariant;

    s32 clipUly = drawState->clipY[0];
    s32 clipLry = drawState->clipY[1];
    s32 clipUlx = drawState->clipX[0];
    s32 clipLrx = drawState->clipX[1];

    s32 rightPosX = posX + (s32)(drawState->charScale.x * messageCharset->texSize.x);
    s32 rightPosY = posY + (s32)(drawState->charScale.y * messageCharset->texSize.y);

    f32 clipOffset;
    s32 texOffsetX;
    s32 texOffsetY;
    s32 ulx, uly, lrx, lry;
    s32 dsdx, dtdy;

    if (posX >= clipLrx || posY >= clipLry || rightPosX <= clipUlx || rightPosY <= clipUly) {
        return;
    }

    if (posX < clipUlx) {
        clipOffset = abs(posX - clipUlx) / drawState->charScale.x;
        texOffsetX = (f32)((clipOffset + 0.5) * 32.0);
        ulx = clipUlx;
    } else {
        texOffsetX = 0;
        ulx = posX;
    }

    if (posY < clipUly) {
        if (!(printer->stateFlags & MSG_STATE_FLAG_400) || posY < 0) {
            clipOffset = abs(posY - clipUly) / drawState->charScale.y;
            texOffsetY = clipOffset * 32.0f;
            uly = clipUly;
        } else {
            texOffsetY = 0;
            uly = posY;
        }
    } else {
        texOffsetY = 0;
        uly = posY;
    }

    lrx = rightPosX;
    if (lrx >= clipLrx) {
        lrx = clipLrx;
    }

    lry = rightPosY;
    if (lry >= clipLry) {
        lry = clipLry;
    }

    dsdx = 1.0f / drawState->charScale.x * 1024.0f;
    dtdy = 1.0f / drawState->charScale.y * 1024.0f;

    if (drawState->printModeFlags & (MSG_PRINT_FLAG_10 | MSG_PRINT_FLAG_1)) {
        drawState->printModeFlags &= ~(MSG_PRINT_FLAG_10 | MSG_PRINT_FLAG_1);
        gDPLoadTLUT_pal16(gMainGfxPos++, 0, D_802F4560[palette]);
    }

    if (messageCharset->texSize.x >= 16 && messageCharset->texSize.x % 16 == 0) {
        gDPLoadTextureBlock_4b(gMainGfxPos++, messageCharset->rasters[fontVariant].raster + messageCharset->charRasterSize * charIndex, G_IM_FMT_CI,
                               messageCharset->texSize.x, messageCharset->texSize.y, 0,
                               G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
    } else {
        gDPLoadTextureTile_4b(gMainGfxPos++, messageCharset->rasters[fontVariant].raster + messageCharset->charRasterSize * charIndex, G_IM_FMT_CI,
                              messageCharset->texSize.x, messageCharset->texSize.y,
                              0, 0, messageCharset->texSize.x - 1, messageCharset->texSize.y - 1, 0,
                              G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
    }
    gSPTextureRectangle(gMainGfxPos++, ulx * 4, uly * 4, lrx * 4, lry * 4, G_TX_RENDERTILE, texOffsetX, texOffsetY,
                        dsdx, dtdy);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel state_step_intro
/* 11C54 80036854 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 11C58 80036858 AFB10014 */  sw        $s1, 0x14($sp)
/* 11C5C 8003685C 3C118011 */  lui       $s1, %hi(gPlayerData)
/* 11C60 80036860 2631F290 */  addiu     $s1, $s1, %lo(gPlayerData)
/* 11C64 80036864 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 11C68 80036868 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 11C6C 8003686C 2404FFFF */  addiu     $a0, $zero, -0x1
/* 11C70 80036870 AFBF0018 */  sw        $ra, 0x18($sp)
/* 11C74 80036874 AFB00010 */  sw        $s0, 0x10($sp)
/* 11C78 80036878 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 11C7C 8003687C 804300A8 */  lb        $v1, 0xA8($v0)
/* 11C80 80036880 1064002F */  beq       $v1, $a0, .L80036940
/* 11C84 80036884 8C450010 */   lw       $a1, 0x10($v0)
/* 11C88 80036888 3C03800A */  lui       $v1, %hi(D_800A0964)
/* 11C8C 8003688C 24630964 */  addiu     $v1, $v1, %lo(D_800A0964)
/* 11C90 80036890 8C620000 */  lw        $v0, 0x0($v1)
/* 11C94 80036894 14400004 */  bnez      $v0, .L800368A8
/* 11C98 80036898 30A2F000 */   andi     $v0, $a1, 0xF000
/* 11C9C 8003689C 10400002 */  beqz      $v0, .L800368A8
/* 11CA0 800368A0 24020001 */   addiu    $v0, $zero, 0x1
/* 11CA4 800368A4 AC620000 */  sw        $v0, 0x0($v1)
.L800368A8:
/* 11CA8 800368A8 3C03800A */  lui       $v1, %hi(D_800A0964)
/* 11CAC 800368AC 8C630964 */  lw        $v1, %lo(D_800A0964)($v1)
/* 11CB0 800368B0 24020001 */  addiu     $v0, $zero, 0x1
/* 11CB4 800368B4 14620010 */  bne       $v1, $v0, .L800368F8
/* 11CB8 800368B8 24020002 */   addiu    $v0, $zero, 0x2
/* 11CBC 800368BC 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* 11CC0 800368C0 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* 11CC4 800368C4 908300AC */  lbu       $v1, 0xAC($a0)
/* 11CC8 800368C8 2C620002 */  sltiu     $v0, $v1, 0x2
/* 11CCC 800368CC 14400018 */  bnez      $v0, .L80036930
/* 11CD0 800368D0 24020064 */   addiu    $v0, $zero, 0x64
/* 11CD4 800368D4 00031600 */  sll       $v0, $v1, 24
/* 11CD8 800368D8 00021603 */  sra       $v0, $v0, 24
/* 11CDC 800368DC 24030004 */  addiu     $v1, $zero, 0x4
/* 11CE0 800368E0 14430003 */  bne       $v0, $v1, .L800368F0
/* 11CE4 800368E4 24020002 */   addiu    $v0, $zero, 0x2
/* 11CE8 800368E8 0800DA4C */  j         .L80036930
/* 11CEC 800368EC 24020064 */   addiu    $v0, $zero, 0x64
.L800368F0:
/* 11CF0 800368F0 3C03800A */  lui       $v1, %hi(D_800A0964)
/* 11CF4 800368F4 8C630964 */  lw        $v1, %lo(D_800A0964)($v1)
.L800368F8:
/* 11CF8 800368F8 14620011 */  bne       $v1, $v0, .L80036940
/* 11CFC 800368FC 00000000 */   nop
/* 11D00 80036900 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* 11D04 80036904 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* 11D08 80036908 908300AC */  lbu       $v1, 0xAC($a0)
/* 11D0C 8003690C 2C620002 */  sltiu     $v0, $v1, 0x2
/* 11D10 80036910 14400005 */  bnez      $v0, .L80036928
/* 11D14 80036914 00031600 */   sll      $v0, $v1, 24
/* 11D18 80036918 00021603 */  sra       $v0, $v0, 24
/* 11D1C 8003691C 24030004 */  addiu     $v1, $zero, 0x4
/* 11D20 80036920 14430007 */  bne       $v0, $v1, .L80036940
/* 11D24 80036924 00000000 */   nop
.L80036928:
/* 11D28 80036928 908200A8 */  lbu       $v0, 0xA8($a0)
/* 11D2C 8003692C 24420001 */  addiu     $v0, $v0, 0x1
.L80036930:
/* 11D30 80036930 0C00D994 */  jal       state_init_intro
/* 11D34 80036934 A08200A8 */   sb       $v0, 0xA8($a0)
/* 11D38 80036938 0800DB72 */  j         .L80036DC8
/* 11D3C 8003693C 00000000 */   nop
.L80036940:
/* 11D40 80036940 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 11D44 80036944 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 11D48 80036948 804300AC */  lb        $v1, 0xAC($v0)
/* 11D4C 8003694C 2C620016 */  sltiu     $v0, $v1, 0x16
/* 11D50 80036950 10400109 */  beqz      $v0, .L80036D78
/* 11D54 80036954 00031080 */   sll      $v0, $v1, 2
/* 11D58 80036958 3C01800A */  lui       $at, %hi(jtbl_80098338)
/* 11D5C 8003695C 00220821 */  addu      $at, $at, $v0
/* 11D60 80036960 8C228338 */  lw        $v0, %lo(jtbl_80098338)($at)
/* 11D64 80036964 00400008 */  jr        $v0
/* 11D68 80036968 00000000 */   nop
glabel .L8003696C
/* 11D6C 8003696C 0C016754 */  jal       update_effects
/* 11D70 80036970 00000000 */   nop
/* 11D74 80036974 0C00B500 */  jal       update_cameras
/* 11D78 80036978 00000000 */   nop
/* 11D7C 8003697C 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 11D80 80036980 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* 11D84 80036984 8E060000 */  lw        $a2, 0x0($s0)
/* 11D88 80036988 80C300A8 */  lb        $v1, 0xA8($a2)
/* 11D8C 8003698C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 11D90 80036990 14620010 */  bne       $v1, $v0, .L800369D4
/* 11D94 80036994 00000000 */   nop
/* 11D98 80036998 44806000 */  mtc1      $zero, $f12
/* 11D9C 8003699C 0C00AFC5 */  jal       set_curtain_fade_goal
/* 11DA0 800369A0 00000000 */   nop
/* 11DA4 800369A4 3C04800A */  lui       $a0, %hi(D_800A0956)
/* 11DA8 800369A8 84840956 */  lh        $a0, %lo(D_800A0956)($a0)
/* 11DAC 800369AC 0C00CE0C */  jal       intro_logos_fade_out
/* 11DB0 800369B0 00000000 */   nop
/* 11DB4 800369B4 104000F0 */  beqz      $v0, .L80036D78
/* 11DB8 800369B8 24020001 */   addiu    $v0, $zero, 0x1
/* 11DBC 800369BC 0000202D */  daddu     $a0, $zero, $zero
/* 11DC0 800369C0 8E030000 */  lw        $v1, 0x0($s0)
/* 11DC4 800369C4 0C00AFC1 */  jal       set_curtain_draw_callback
/* 11DC8 800369C8 A06200AC */   sb       $v0, 0xAC($v1)
/* 11DCC 800369CC 0800DB5E */  j         .L80036D78
/* 11DD0 800369D0 00000000 */   nop
.L800369D4:
/* 11DD4 800369D4 3C05800A */  lui       $a1, %hi(D_800A0954)
/* 11DD8 800369D8 24A50954 */  addiu     $a1, $a1, %lo(D_800A0954)
/* 11DDC 800369DC 94A20000 */  lhu       $v0, 0x0($a1)
/* 11DE0 800369E0 3C03800A */  lui       $v1, %hi(D_800A0956)
/* 11DE4 800369E4 94630956 */  lhu       $v1, %lo(D_800A0956)($v1)
/* 11DE8 800369E8 00431021 */  addu      $v0, $v0, $v1
/* 11DEC 800369EC A4A20000 */  sh        $v0, 0x0($a1)
/* 11DF0 800369F0 00021400 */  sll       $v0, $v0, 16
/* 11DF4 800369F4 00021403 */  sra       $v0, $v0, 16
/* 11DF8 800369F8 284200FF */  slti      $v0, $v0, 0xFF
/* 11DFC 800369FC 144000DE */  bnez      $v0, .L80036D78
/* 11E00 80036A00 240200FF */   addiu    $v0, $zero, 0xFF
/* 11E04 80036A04 0000202D */  daddu     $a0, $zero, $zero
/* 11E08 80036A08 A4A20000 */  sh        $v0, 0x0($a1)
/* 11E0C 80036A0C 24020001 */  addiu     $v0, $zero, 0x1
/* 11E10 80036A10 0C00AFC1 */  jal       set_curtain_draw_callback
/* 11E14 80036A14 A0C200AC */   sb       $v0, 0xAC($a2)
/* 11E18 80036A18 0800DB5E */  j         .L80036D78
/* 11E1C 80036A1C 00000000 */   nop
glabel .L80036A20
/* 11E20 80036A20 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 11E24 80036A24 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
/* 11E28 80036A28 8C820000 */  lw        $v0, 0x0($a0)
/* 11E2C 80036A2C 24030004 */  addiu     $v1, $zero, 0x4
/* 11E30 80036A30 3C01800A */  lui       $at, %hi(D_800A0950)
/* 11E34 80036A34 AC230950 */  sw        $v1, %lo(D_800A0950)($at)
/* 11E38 80036A38 34420008 */  ori       $v0, $v0, 0x8
/* 11E3C 80036A3C AC820000 */  sw        $v0, 0x0($a0)
/* 11E40 80036A40 3C03800A */  lui       $v1, %hi(D_800A0960)
/* 11E44 80036A44 8C630960 */  lw        $v1, %lo(D_800A0960)($v1)
/* 11E48 80036A48 2402000E */  addiu     $v0, $zero, 0xE
/* 11E4C 80036A4C 106200CA */  beq       $v1, $v0, .L80036D78
/* 11E50 80036A50 00000000 */   nop
/* 11E54 80036A54 0800DAA3 */  j         .L80036A8C
/* 11E58 80036A58 00000000 */   nop
glabel .L80036A5C
/* 11E5C 80036A5C 3C03800A */  lui       $v1, %hi(D_800A0950)
/* 11E60 80036A60 24630950 */  addiu     $v1, $v1, %lo(D_800A0950)
/* 11E64 80036A64 8C620000 */  lw        $v0, 0x0($v1)
/* 11E68 80036A68 2442FFFF */  addiu     $v0, $v0, -0x1
/* 11E6C 80036A6C 1C4000C2 */  bgtz      $v0, .L80036D78
/* 11E70 80036A70 AC620000 */   sw       $v0, 0x0($v1)
/* 11E74 80036A74 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 11E78 80036A78 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
/* 11E7C 80036A7C 8C820000 */  lw        $v0, 0x0($a0)
/* 11E80 80036A80 2403FFF7 */  addiu     $v1, $zero, -0x9
/* 11E84 80036A84 00431024 */  and       $v0, $v0, $v1
/* 11E88 80036A88 AC820000 */  sw        $v0, 0x0($a0)
.L80036A8C:
/* 11E8C 80036A8C 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 11E90 80036A90 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 11E94 80036A94 24020002 */  addiu     $v0, $zero, 0x2
/* 11E98 80036A98 0800DB5E */  j         .L80036D78
/* 11E9C 80036A9C A06200AC */   sb       $v0, 0xAC($v1)
glabel .L80036AA0
/* 11EA0 80036AA0 0C00AFC1 */  jal       set_curtain_draw_callback
/* 11EA4 80036AA4 0000202D */   daddu    $a0, $zero, $zero
/* 11EA8 80036AA8 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 11EAC 80036AAC 2463419C */  addiu     $v1, $v1, %lo(gGameStatusPtr)
/* 11EB0 80036AB0 8C620000 */  lw        $v0, 0x0($v1)
/* 11EB4 80036AB4 A0400070 */  sb        $zero, 0x70($v0)
/* 11EB8 80036AB8 8C620000 */  lw        $v0, 0x0($v1)
/* 11EBC 80036ABC A0400076 */  sb        $zero, 0x76($v0)
/* 11EC0 80036AC0 8C620000 */  lw        $v0, 0x0($v1)
/* 11EC4 80036AC4 A0400078 */  sb        $zero, 0x78($v0)
/* 11EC8 80036AC8 8C620000 */  lw        $v0, 0x0($v1)
/* 11ECC 80036ACC A040007D */  sb        $zero, 0x7D($v0)
/* 11ED0 80036AD0 8C620000 */  lw        $v0, 0x0($v1)
/* 11ED4 80036AD4 804200A8 */  lb        $v0, 0xA8($v0)
/* 11ED8 80036AD8 2405FFFF */  addiu     $a1, $zero, -0x1
/* 11EDC 80036ADC 14450037 */  bne       $v0, $a1, .L80036BBC
/* 11EE0 80036AE0 2404000B */   addiu    $a0, $zero, 0xB
/* 11EE4 80036AE4 0C00AB00 */  jal       general_heap_create
/* 11EE8 80036AE8 00000000 */   nop
/* 11EEC 80036AEC 0C047624 */  jal       clear_render_tasks
/* 11EF0 80036AF0 00000000 */   nop
/* 11EF4 80036AF4 0C048C2E */  jal       clear_worker_list
/* 11EF8 80036AF8 00000000 */   nop
/* 11EFC 80036AFC 0C0B0C77 */  jal       clear_script_list
/* 11F00 80036B00 00000000 */   nop
/* 11F04 80036B04 0C00B7BD */  jal       create_cameras_a
/* 11F08 80036B08 00000000 */   nop
/* 11F0C 80036B0C 0C0B763E */  jal       spr_init_sprites
/* 11F10 80036B10 0000202D */   daddu    $a0, $zero, $zero
/* 11F14 80036B14 0C0482EC */  jal       clear_entity_models
/* 11F18 80036B18 00000000 */   nop
/* 11F1C 80036B1C 0C047889 */  jal       clear_animator_list
/* 11F20 80036B20 00000000 */   nop
/* 11F24 80036B24 0C045751 */  jal       clear_model_data
/* 11F28 80036B28 00000000 */   nop
/* 11F2C 80036B2C 0C052010 */  jal       clear_sprite_shading_data
/* 11F30 80036B30 00000000 */   nop
/* 11F34 80036B34 0C05177E */  jal       reset_background_settings
/* 11F38 80036B38 00000000 */   nop
/* 11F3C 80036B3C 0C050440 */  jal       hud_element_clear_cache
/* 11F40 80036B40 00000000 */   nop
/* 11F44 80036B44 0C0515A0 */  jal       clear_trigger_data
/* 11F48 80036B48 00000000 */   nop
/* 11F4C 80036B4C 0C048D9D */  jal       clear_printers
/* 11F50 80036B50 00000000 */   nop
/* 11F54 80036B54 0C04432E */  jal       clear_entity_data
/* 11F58 80036B58 0000202D */   daddu    $a0, $zero, $zero
/* 11F5C 80036B5C 0C04E042 */  jal       clear_screen_overlays
/* 11F60 80036B60 00000000 */   nop
/* 11F64 80036B64 0C037F14 */  jal       clear_player_status
/* 11F68 80036B68 00000000 */   nop
/* 11F6C 80036B6C 0C00E12F */  jal       clear_npcs
/* 11F70 80036B70 00000000 */   nop
/* 11F74 80036B74 0C039CE8 */  jal       clear_player_data
/* 11F78 80036B78 00000000 */   nop
/* 11F7C 80036B7C 0C01CACC */  jal       reset_battle_status
/* 11F80 80036B80 00000000 */   nop
/* 11F84 80036B84 0C00F8CE */  jal       init_encounter_status
/* 11F88 80036B88 00000000 */   nop
/* 11F8C 80036B8C 0C016727 */  jal       clear_effect_data
/* 11F90 80036B90 00000000 */   nop
/* 11F94 80036B94 0C04C3FC */  jal       clear_item_entity_data
/* 11F98 80036B98 00000000 */   nop
/* 11F9C 80036B9C 0C0514C8 */  jal       clear_saved_variables
/* 11FA0 80036BA0 00000000 */   nop
/* 11FA4 80036BA4 0C016BE5 */  jal       initialize_collision
/* 11FA8 80036BA8 00000000 */   nop
/* 11FAC 80036BAC 0C00CD3C */  jal       set_game_mode
/* 11FB0 80036BB0 24040002 */   addiu    $a0, $zero, 0x2
/* 11FB4 80036BB4 0800DB72 */  j         .L80036DC8
/* 11FB8 80036BB8 00000000 */   nop
.L80036BBC:
/* 11FBC 80036BBC 26230058 */  addiu     $v1, $s1, 0x58
/* 11FC0 80036BC0 2402000A */  addiu     $v0, $zero, 0xA
/* 11FC4 80036BC4 A2220002 */  sb        $v0, 0x2($s1)
/* 11FC8 80036BC8 A2220003 */  sb        $v0, 0x3($s1)
/* 11FCC 80036BCC A2220004 */  sb        $v0, 0x4($s1)
/* 11FD0 80036BD0 24020005 */  addiu     $v0, $zero, 0x5
/* 11FD4 80036BD4 A2220005 */  sb        $v0, 0x5($s1)
/* 11FD8 80036BD8 A2220006 */  sb        $v0, 0x6($s1)
/* 11FDC 80036BDC A2220007 */  sb        $v0, 0x7($s1)
/* 11FE0 80036BE0 24020002 */  addiu     $v0, $zero, 0x2
/* 11FE4 80036BE4 A2220008 */  sb        $v0, 0x8($s1)
/* 11FE8 80036BE8 A2200000 */  sb        $zero, 0x0($s1)
/* 11FEC 80036BEC A2250001 */  sb        $a1, 0x1($s1)
/* 11FF0 80036BF0 A220000E */  sb        $zero, 0xE($s1)
/* 11FF4 80036BF4 A2200009 */  sb        $zero, 0x9($s1)
.L80036BF8:
/* 11FF8 80036BF8 A0600014 */  sb        $zero, 0x14($v1)
/* 11FFC 80036BFC 2484FFFF */  addiu     $a0, $a0, -0x1
/* 12000 80036C00 0481FFFD */  bgez      $a0, .L80036BF8
/* 12004 80036C04 2463FFF8 */   addiu    $v1, $v1, -0x8
/* 12008 80036C08 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 1200C 80036C0C 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* 12010 80036C10 8E020000 */  lw        $v0, 0x0($s0)
/* 12014 80036C14 A2200012 */  sb        $zero, 0x12($s1)
/* 12018 80036C18 84440086 */  lh        $a0, 0x86($v0)
/* 1201C 80036C1C 8445008C */  lh        $a1, 0x8C($v0)
/* 12020 80036C20 0C0169BD */  jal       load_map_by_IDs
/* 12024 80036C24 0000302D */   daddu    $a2, $zero, $zero
/* 12028 80036C28 8E030000 */  lw        $v1, 0x0($s0)
/* 1202C 80036C2C 24020003 */  addiu     $v0, $zero, 0x3
/* 12030 80036C30 0C03805E */  jal       disable_player_input
/* 12034 80036C34 A06200AC */   sb       $v0, 0xAC($v1)
/* 12038 80036C38 0800DB5E */  j         .L80036D78
/* 1203C 80036C3C 00000000 */   nop
glabel .L80036C40
/* 12040 80036C40 3C04800A */  lui       $a0, %hi(D_800A0960)
/* 12044 80036C44 24840960 */  addiu     $a0, $a0, %lo(D_800A0960)
/* 12048 80036C48 8C830000 */  lw        $v1, 0x0($a0)
/* 1204C 80036C4C 2402000E */  addiu     $v0, $zero, 0xE
/* 12050 80036C50 14620004 */  bne       $v1, $v0, .L80036C64
/* 12054 80036C54 240200FF */   addiu    $v0, $zero, 0xFF
/* 12058 80036C58 2402000F */  addiu     $v0, $zero, 0xF
/* 1205C 80036C5C AC820000 */  sw        $v0, 0x0($a0)
/* 12060 80036C60 240200FF */  addiu     $v0, $zero, 0xFF
.L80036C64:
/* 12064 80036C64 3C04800A */  lui       $a0, %hi(gOverrideFlags)
/* 12068 80036C68 2484A650 */  addiu     $a0, $a0, %lo(gOverrideFlags)
/* 1206C 80036C6C 2405FFF7 */  addiu     $a1, $zero, -0x9
/* 12070 80036C70 3C03800A */  lui       $v1, %hi(D_800A0958)
/* 12074 80036C74 94630958 */  lhu       $v1, %lo(D_800A0958)($v1)
/* 12078 80036C78 3C06800B */  lui       $a2, %hi(gCameras)
/* 1207C 80036C7C 24C61D80 */  addiu     $a2, $a2, %lo(gCameras)
/* 12080 80036C80 00431023 */  subu      $v0, $v0, $v1
/* 12084 80036C84 3C01800A */  lui       $at, %hi(D_800A0954)
/* 12088 80036C88 A4220954 */  sh        $v0, %lo(D_800A0954)($at)
/* 1208C 80036C8C 8C830000 */  lw        $v1, 0x0($a0)
/* 12090 80036C90 94C20000 */  lhu       $v0, 0x0($a2)
/* 12094 80036C94 00651824 */  and       $v1, $v1, $a1
/* 12098 80036C98 3042FFFD */  andi      $v0, $v0, 0xFFFD
/* 1209C 80036C9C AC830000 */  sw        $v1, 0x0($a0)
/* 120A0 80036CA0 A4C20000 */  sh        $v0, 0x0($a2)
/* 120A4 80036CA4 2402FFFD */  addiu     $v0, $zero, -0x3
/* 120A8 80036CA8 00621824 */  and       $v1, $v1, $v0
/* 120AC 80036CAC 0C037DD0 */  jal       update_player
/* 120B0 80036CB0 AC830000 */   sw       $v1, 0x0($a0)
/* 120B4 80036CB4 0C00F949 */  jal       update_encounters
/* 120B8 80036CB8 00000000 */   nop
/* 120BC 80036CBC 0C00E64C */  jal       update_npcs
/* 120C0 80036CC0 00000000 */   nop
/* 120C4 80036CC4 0C016754 */  jal       update_effects
/* 120C8 80036CC8 00000000 */   nop
/* 120CC 80036CCC 0C00B500 */  jal       update_cameras
/* 120D0 80036CD0 00000000 */   nop
/* 120D4 80036CD4 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 120D8 80036CD8 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* 120DC 80036CDC 8E020000 */  lw        $v0, 0x0($s0)
/* 120E0 80036CE0 0C0B1059 */  jal       does_script_exist
/* 120E4 80036CE4 8C44006C */   lw       $a0, 0x6C($v0)
/* 120E8 80036CE8 14400037 */  bnez      $v0, .L80036DC8
/* 120EC 80036CEC 24030004 */   addiu    $v1, $zero, 0x4
/* 120F0 80036CF0 8E020000 */  lw        $v0, 0x0($s0)
/* 120F4 80036CF4 94440086 */  lhu       $a0, 0x86($v0)
/* 120F8 80036CF8 A04300AC */  sb        $v1, 0xAC($v0)
/* 120FC 80036CFC 0800DB5E */  j         .L80036D78
/* 12100 80036D00 A4440088 */   sh       $a0, 0x88($v0)
glabel .L80036D04
/* 12104 80036D04 0C016754 */  jal       update_effects
/* 12108 80036D08 00000000 */   nop
/* 1210C 80036D0C 0C00B500 */  jal       update_cameras
/* 12110 80036D10 00000000 */   nop
/* 12114 80036D14 0C00E64C */  jal       update_npcs
/* 12118 80036D18 00000000 */   nop
/* 1211C 80036D1C 3C04800A */  lui       $a0, %hi(D_800A0954)
/* 12120 80036D20 24840954 */  addiu     $a0, $a0, %lo(D_800A0954)
/* 12124 80036D24 84820000 */  lh        $v0, 0x0($a0)
/* 12128 80036D28 1440000C */  bnez      $v0, .L80036D5C
/* 1212C 80036D2C 94830000 */   lhu      $v1, 0x0($a0)
/* 12130 80036D30 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 12134 80036D34 4481A000 */  mtc1      $at, $f20
/* 12138 80036D38 00000000 */  nop
/* 1213C 80036D3C 4405A000 */  mfc1      $a1, $f20
/* 12140 80036D40 0C04DF62 */  jal       set_screen_overlay_params_front
/* 12144 80036D44 240400FF */   addiu    $a0, $zero, 0xFF
/* 12148 80036D48 4405A000 */  mfc1      $a1, $f20
/* 1214C 80036D4C 0C04DF69 */  jal       set_screen_overlay_params_back
/* 12150 80036D50 240400FF */   addiu    $a0, $zero, 0xFF
/* 12154 80036D54 0800DB5E */  j         .L80036D78
/* 12158 80036D58 00000000 */   nop
.L80036D5C:
/* 1215C 80036D5C 3C02800A */  lui       $v0, %hi(D_800A0958)
/* 12160 80036D60 94420958 */  lhu       $v0, %lo(D_800A0958)($v0)
/* 12164 80036D64 00621023 */  subu      $v0, $v1, $v0
/* 12168 80036D68 A4820000 */  sh        $v0, 0x0($a0)
/* 1216C 80036D6C 00021400 */  sll       $v0, $v0, 16
/* 12170 80036D70 04420001 */  bltzl     $v0, .L80036D78
/* 12174 80036D74 A4800000 */   sh       $zero, 0x0($a0)
glabel .L80036D78
/* 12178 80036D78 3C02800A */  lui       $v0, %hi(D_800A0954)
/* 1217C 80036D7C 84420954 */  lh        $v0, %lo(D_800A0954)($v0)
/* 12180 80036D80 3C04800A */  lui       $a0, %hi(D_800A0963)
/* 12184 80036D84 90840963 */  lbu       $a0, %lo(D_800A0963)($a0)
/* 12188 80036D88 44820000 */  mtc1      $v0, $f0
/* 1218C 80036D8C 00000000 */  nop
/* 12190 80036D90 46800020 */  cvt.s.w   $f0, $f0
/* 12194 80036D94 44050000 */  mfc1      $a1, $f0
/* 12198 80036D98 0C04DF69 */  jal       set_screen_overlay_params_back
/* 1219C 80036D9C 00000000 */   nop
/* 121A0 80036DA0 3C05800A */  lui       $a1, %hi(D_800A095B)
/* 121A4 80036DA4 90A5095B */  lbu       $a1, %lo(D_800A095B)($a1)
/* 121A8 80036DA8 3C06800A */  lui       $a2, %hi(D_800A095D)
/* 121AC 80036DAC 90C6095D */  lbu       $a2, %lo(D_800A095D)($a2)
/* 121B0 80036DB0 3C07800A */  lui       $a3, %hi(D_800A095F)
/* 121B4 80036DB4 90E7095F */  lbu       $a3, %lo(D_800A095F)($a3)
/* 121B8 80036DB8 0C04DF84 */  jal       set_screen_overlay_color
/* 121BC 80036DBC 24040001 */   addiu    $a0, $zero, 0x1
/* 121C0 80036DC0 0C00CE1D */  jal       intro_logos_update_fade
/* 121C4 80036DC4 00000000 */   nop
.L80036DC8:
/* 121C8 80036DC8 8FBF0018 */  lw        $ra, 0x18($sp)
/* 121CC 80036DCC 8FB10014 */  lw        $s1, 0x14($sp)
/* 121D0 80036DD0 8FB00010 */  lw        $s0, 0x10($sp)
/* 121D4 80036DD4 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 121D8 80036DD8 03E00008 */  jr        $ra
/* 121DC 80036DDC 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void state_step_intro(void) {
    PlayerData* playerData = &gPlayerData;
    u32 pressedButtons = gGameStatusPtr->pressedButtons[0];
    s32 i;

    if (gGameStatusPtr->creditsViewportMode != -1) {
        if (D_800A0964 == 0 && pressedButtons & (BUTTON_A | BUTTON_B | BUTTON_START | BUTTON_Z)) {
            D_800A0964 = 1;
        }

        if (D_800A0964 == 1 && (gGameStatusPtr->introState == INTRO_STATE_0 ||
                                gGameStatusPtr->introState == INTRO_STATE_1 ||
                                gGameStatusPtr->introState == INTRO_STATE_4))
        {
            gGameStatusPtr->creditsViewportMode = 100;
            state_init_intro();
            return;
        }

        if (D_800A0964 == 2 && (gGameStatusPtr->introState == INTRO_STATE_0 ||
                                gGameStatusPtr->introState == INTRO_STATE_1 ||
                                gGameStatusPtr->introState == INTRO_STATE_4))
        {
            gGameStatusPtr->creditsViewportMode++;
            state_init_intro();
            return;
        }
    }

    switch (gGameStatusPtr->introState) {
        case INTRO_STATE_0:
            update_effects();
            update_cameras();
            if (gGameStatusPtr->creditsViewportMode == -1) {
                set_curtain_fade_goal(0.0f);
                if (intro_logos_fade_out(D_800A0956)) {
                    gGameStatusPtr->introState = INTRO_STATE_1;
                    set_curtain_draw_callback(NULL);
                }
            } else {
                D_800A0954 += D_800A0956;
                if (D_800A0954 >= 0xFF) {
                    D_800A0954 = 0xFF;
                    gGameStatusPtr->introState = INTRO_STATE_1;
                    set_curtain_draw_callback(NULL);
                }
            }
            break;
        case INTRO_STATE_1:
            D_800A0950 = 4;
            gOverrideFlags |= GLOBAL_OVERRIDES_8;
            if (D_800A0960 != 0xE) {
                gGameStatusPtr->introState = INTRO_STATE_2;
            }
            break;
        case INTRO_STATE_15:
            D_800A0950--;
            if (D_800A0950 <= 0) {
                gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
                gGameStatusPtr->introState = INTRO_STATE_2;
            }
            break;
        case INTRO_STATE_2:
            set_curtain_draw_callback(NULL);
            gGameStatusPtr->isBattle = FALSE;
            gGameStatusPtr->unk_76 = 0;
            gGameStatusPtr->disableScripts = FALSE;
            gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;

            if (gGameStatusPtr->creditsViewportMode == -1) {
                general_heap_create();
                clear_render_tasks();
                clear_worker_list();
                clear_script_list();
                create_cameras_a();
                spr_init_sprites(PLAYER_SPRITES_MARIO_WORLD);
                clear_entity_models();
                clear_animator_list();
                clear_model_data();
                clear_sprite_shading_data();
                reset_background_settings();
                hud_element_clear_cache();
                clear_trigger_data();
                clear_printers();
                clear_entity_data(0);
                clear_screen_overlays();
                clear_player_status();
                clear_npcs();
                clear_player_data();
                reset_battle_status();
                init_encounter_status();
                clear_effect_data();
                clear_item_entity_data();
                clear_saved_variables();
                initialize_collision();
                set_game_mode(GAME_MODE_TITLE_SCREEN);
                return;
            }

            playerData->curHP = 10;
            playerData->curMaxHP = 10;
            playerData->hardMaxHP = 10;
            playerData->curFP = 5;
            playerData->curMaxFP = 5;
            playerData->hardMaxFP = 5;
            playerData->maxBP = 2;
            playerData->bootsLevel = 0;
            playerData->hammerLevel = -1;
            playerData->fortressKeyCount = 0;
            playerData->level = 0;

            for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
                playerData->partners[i].enabled = 0;
            }

            playerData->currentPartner = PARTNER_NONE;
            load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, 0);
            gGameStatusPtr->introState = INTRO_STATE_3;
            disable_player_input();
            break;
        case INTRO_STATE_3:
            if (D_800A0960 == 0xE) {
                D_800A0960 = 0xF;
            }
            D_800A0954 = 255 - D_800A0958;
            gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
            gCameras[CAM_DEFAULT].flags &= ~0x2;
            gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD;
            update_player();
            update_encounters();
            update_npcs();
            update_effects();
            update_cameras();
            if (!does_script_exist(gGameStatusPtr->mainScriptID)) {
                gGameStatusPtr->prevArea = gGameStatusPtr->areaID;
                gGameStatusPtr->introState = INTRO_STATE_4;
                break;
            }
            return;
        case INTRO_STATE_4:
            update_effects();
            update_cameras();
            update_npcs();
            if (D_800A0954 == 0) {
                set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
                set_screen_overlay_params_back(OVERLAY_NONE, -1.0f);
            } else {
                D_800A0954 -= D_800A0958;
                if (D_800A0954 < 0) {
                    D_800A0954 = 0;
                }
            }
            break;
    }

    set_screen_overlay_params_back(D_800A0963, D_800A0954);
    set_screen_overlay_color(SCREEN_LAYER_BACK, D_800A095B, D_800A095D, D_800A095F);
    intro_logos_update_fade();
}