### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_number
/* BDD9C 8012769C 27BDFF38 */  addiu     $sp, $sp, -0xC8
/* BDDA0 801276A0 AFB200A8 */  sw        $s2, 0xA8($sp)
/* BDDA4 801276A4 AFB500B4 */  sw        $s5, 0xB4($sp)
/* BDDA8 801276A8 00E0A82D */  daddu     $s5, $a3, $zero
/* BDDAC 801276AC 3C028015 */  lui       $v0, %hi(gMsgNumbers)
/* BDDB0 801276B0 2442C340 */  addiu     $v0, $v0, %lo(gMsgNumbers)
/* BDDB4 801276B4 00151880 */  sll       $v1, $s5, 2
/* BDDB8 801276B8 00751821 */  addu      $v1, $v1, $s5
/* BDDBC 801276BC 00031880 */  sll       $v1, $v1, 2
/* BDDC0 801276C0 00621821 */  addu      $v1, $v1, $v0
/* BDDC4 801276C4 AFB400B0 */  sw        $s4, 0xB0($sp)
/* BDDC8 801276C8 24D4FFFE */  addiu     $s4, $a2, -0x2
/* BDDCC 801276CC AFB100A4 */  sw        $s1, 0xA4($sp)
/* BDDD0 801276D0 97B100E2 */  lhu       $s1, 0xE2($sp)
/* BDDD4 801276D4 2E8200F1 */  sltiu     $v0, $s4, 0xF1
/* BDDD8 801276D8 AFBF00C4 */  sw        $ra, 0xC4($sp)
/* BDDDC 801276DC AFBE00C0 */  sw        $fp, 0xC0($sp)
/* BDDE0 801276E0 AFB700BC */  sw        $s7, 0xBC($sp)
/* BDDE4 801276E4 AFB600B8 */  sw        $s6, 0xB8($sp)
/* BDDE8 801276E8 AFB300AC */  sw        $s3, 0xAC($sp)
/* BDDEC 801276EC AFB000A0 */  sw        $s0, 0xA0($sp)
/* BDDF0 801276F0 8C7E0000 */  lw        $fp, 0x0($v1)
/* BDDF4 801276F4 90770004 */  lbu       $s7, 0x4($v1)
/* BDDF8 801276F8 10400111 */  beqz      $v0, .L80127B40
/* BDDFC 801276FC 00A0902D */   daddu    $s2, $a1, $zero
/* BDE00 80127700 27A50010 */  addiu     $a1, $sp, 0x10
/* BDE04 80127704 0C00A531 */  jal       int_to_string
/* BDE08 80127708 2406000A */   addiu    $a2, $zero, 0xA
/* BDE0C 8012770C 0000802D */  daddu     $s0, $zero, $zero
/* BDE10 80127710 27A50010 */  addiu     $a1, $sp, 0x10
/* BDE14 80127714 27A40028 */  addiu     $a0, $sp, 0x28
/* BDE18 80127718 00B01021 */  addu      $v0, $a1, $s0
.L8012771C:
/* BDE1C 8012771C 90420000 */  lbu       $v0, 0x0($v0)
/* BDE20 80127720 1040000B */  beqz      $v0, .L80127750
/* BDE24 80127724 2443FFD0 */   addiu    $v1, $v0, -0x30
/* BDE28 80127728 306200FF */  andi      $v0, $v1, 0xFF
/* BDE2C 8012772C 2C42000A */  sltiu     $v0, $v0, 0xA
/* BDE30 80127730 50400004 */  beql      $v0, $zero, .L80127744
/* BDE34 80127734 26100001 */   addiu    $s0, $s0, 0x1
/* BDE38 80127738 00901021 */  addu      $v0, $a0, $s0
/* BDE3C 8012773C A0430000 */  sb        $v1, 0x0($v0)
/* BDE40 80127740 26100001 */  addiu     $s0, $s0, 0x1
.L80127744:
/* BDE44 80127744 2A02000A */  slti      $v0, $s0, 0xA
/* BDE48 80127748 1440FFF4 */  bnez      $v0, .L8012771C
/* BDE4C 8012774C 00B01021 */   addu     $v0, $a1, $s0
.L80127750:
/* BDE50 80127750 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* BDE54 80127754 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* BDE58 80127758 0240302D */  daddu     $a2, $s2, $zero
/* BDE5C 8012775C 8C620000 */  lw        $v0, 0x0($v1)
/* BDE60 80127760 0040202D */  daddu     $a0, $v0, $zero
/* BDE64 80127764 24420008 */  addiu     $v0, $v0, 0x8
/* BDE68 80127768 AC620000 */  sw        $v0, 0x0($v1)
/* BDE6C 8012776C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* BDE70 80127770 AC820000 */  sw        $v0, 0x0($a0)
/* BDE74 80127774 3C028015 */  lui       $v0, %hi(gMsgDlistInitDrawNumber)
/* BDE78 80127778 2442C368 */  addiu     $v0, $v0, %lo(gMsgDlistInitDrawNumber)
/* BDE7C 8012777C AC820004 */  sw        $v0, 0x4($a0)
/* BDE80 80127780 32220001 */  andi      $v0, $s1, 0x1
/* BDE84 80127784 1040001E */  beqz      $v0, .L80127800
/* BDE88 80127788 0200982D */   daddu    $s3, $s0, $zero
/* BDE8C 8012778C 2610FFFF */  addiu     $s0, $s0, -0x1
/* BDE90 80127790 06000035 */  bltz      $s0, .L80127868
/* BDE94 80127794 00151080 */   sll      $v0, $s5, 2
/* BDE98 80127798 32290002 */  andi      $t1, $s1, 0x2
/* BDE9C 8012779C 3C058015 */  lui       $a1, %hi(gMsgNumbers)
/* BDEA0 801277A0 24A5C340 */  addiu     $a1, $a1, %lo(gMsgNumbers)
/* BDEA4 801277A4 00551021 */  addu      $v0, $v0, $s5
/* BDEA8 801277A8 00022080 */  sll       $a0, $v0, 2
/* BDEAC 801277AC 00854021 */  addu      $t0, $a0, $a1
/* BDEB0 801277B0 27A70028 */  addiu     $a3, $sp, 0x28
/* BDEB4 801277B4 27A30040 */  addiu     $v1, $sp, 0x40
/* BDEB8 801277B8 00101080 */  sll       $v0, $s0, 2
/* BDEBC 801277BC 00431821 */  addu      $v1, $v0, $v1
.L801277C0:
/* BDEC0 801277C0 11200004 */  beqz      $t1, .L801277D4
/* BDEC4 801277C4 00F01021 */   addu     $v0, $a3, $s0
/* BDEC8 801277C8 91020011 */  lbu       $v0, 0x11($t0)
/* BDECC 801277CC 08049DFA */  j         .L801277E8
/* BDED0 801277D0 00C23023 */   subu     $a2, $a2, $v0
.L801277D4:
/* BDED4 801277D4 90420000 */  lbu       $v0, 0x0($v0)
/* BDED8 801277D8 00441021 */  addu      $v0, $v0, $a0
/* BDEDC 801277DC 00451021 */  addu      $v0, $v0, $a1
/* BDEE0 801277E0 90420007 */  lbu       $v0, 0x7($v0)
/* BDEE4 801277E4 00C23023 */  subu      $a2, $a2, $v0
.L801277E8:
/* BDEE8 801277E8 AC660000 */  sw        $a2, 0x0($v1)
/* BDEEC 801277EC 2610FFFF */  addiu     $s0, $s0, -0x1
/* BDEF0 801277F0 0601FFF3 */  bgez      $s0, .L801277C0
/* BDEF4 801277F4 2463FFFC */   addiu    $v1, $v1, -0x4
/* BDEF8 801277F8 08049E1B */  j         .L8012786C
/* BDEFC 801277FC 32220004 */   andi     $v0, $s1, 0x4
.L80127800:
/* BDF00 80127800 1A600019 */  blez      $s3, .L80127868
/* BDF04 80127804 0000802D */   daddu    $s0, $zero, $zero
/* BDF08 80127808 32290002 */  andi      $t1, $s1, 0x2
/* BDF0C 8012780C 3C058015 */  lui       $a1, %hi(gMsgNumbers)
/* BDF10 80127810 24A5C340 */  addiu     $a1, $a1, %lo(gMsgNumbers)
/* BDF14 80127814 00151080 */  sll       $v0, $s5, 2
/* BDF18 80127818 00551021 */  addu      $v0, $v0, $s5
/* BDF1C 8012781C 00022080 */  sll       $a0, $v0, 2
/* BDF20 80127820 00854021 */  addu      $t0, $a0, $a1
/* BDF24 80127824 27A70028 */  addiu     $a3, $sp, 0x28
/* BDF28 80127828 27A30040 */  addiu     $v1, $sp, 0x40
.L8012782C:
/* BDF2C 8012782C 11200004 */  beqz      $t1, .L80127840
/* BDF30 80127830 AC660000 */   sw       $a2, 0x0($v1)
/* BDF34 80127834 91020011 */  lbu       $v0, 0x11($t0)
/* BDF38 80127838 08049E16 */  j         .L80127858
/* BDF3C 8012783C 00C23021 */   addu     $a2, $a2, $v0
.L80127840:
/* BDF40 80127840 00F01021 */  addu      $v0, $a3, $s0
/* BDF44 80127844 90420000 */  lbu       $v0, 0x0($v0)
/* BDF48 80127848 00441021 */  addu      $v0, $v0, $a0
/* BDF4C 8012784C 00451021 */  addu      $v0, $v0, $a1
/* BDF50 80127850 90420007 */  lbu       $v0, 0x7($v0)
/* BDF54 80127854 00C23021 */  addu      $a2, $a2, $v0
.L80127858:
/* BDF58 80127858 26100001 */  addiu     $s0, $s0, 0x1
/* BDF5C 8012785C 0213102A */  slt       $v0, $s0, $s3
/* BDF60 80127860 1440FFF2 */  bnez      $v0, .L8012782C
/* BDF64 80127864 24630004 */   addiu    $v1, $v1, 0x4
.L80127868:
/* BDF68 80127868 32220004 */  andi      $v0, $s1, 0x4
.L8012786C:
/* BDF6C 8012786C 10400038 */  beqz      $v0, .L80127950
/* BDF70 80127870 00000000 */   nop
/* BDF74 80127874 1A600036 */  blez      $s3, .L80127950
/* BDF78 80127878 0000802D */   daddu    $s0, $zero, $zero
/* BDF7C 8012787C 3C11800A */  lui       $s1, %hi(gMainGfxPos)
/* BDF80 80127880 2631A66C */  addiu     $s1, $s1, %lo(gMainGfxPos)
/* BDF84 80127884 3C12E700 */  lui       $s2, (0xE7000000 >> 16)
/* BDF88 80127888 3C16E200 */  lui       $s6, (0xE200001C >> 16)
/* BDF8C 8012788C 36D6001C */  ori       $s6, $s6, (0xE200001C & 0xFFFF)
.L80127890:
/* BDF90 80127890 3C040050 */  lui       $a0, (0x504240 >> 16)
/* BDF94 80127894 34844240 */  ori       $a0, $a0, (0x504240 & 0xFFFF)
/* BDF98 80127898 3C07FCFF */  lui       $a3, (0xFCFF97FF >> 16)
/* BDF9C 8012789C 34E797FF */  ori       $a3, $a3, (0xFCFF97FF & 0xFFFF)
/* BDFA0 801278A0 3C06FF2D */  lui       $a2, (0xFF2DFEFF >> 16)
/* BDFA4 801278A4 34C6FEFF */  ori       $a2, $a2, (0xFF2DFEFF & 0xFFFF)
/* BDFA8 801278A8 3C082828 */  lui       $t0, (0x28282848 >> 16)
/* BDFAC 801278AC 35082848 */  ori       $t0, $t0, (0x28282848 & 0xFFFF)
/* BDFB0 801278B0 8E230000 */  lw        $v1, 0x0($s1)
/* BDFB4 801278B4 02A0282D */  daddu     $a1, $s5, $zero
/* BDFB8 801278B8 0060102D */  daddu     $v0, $v1, $zero
/* BDFBC 801278BC 24630008 */  addiu     $v1, $v1, 0x8
/* BDFC0 801278C0 AE230000 */  sw        $v1, 0x0($s1)
/* BDFC4 801278C4 AC520000 */  sw        $s2, 0x0($v0)
/* BDFC8 801278C8 AC400004 */  sw        $zero, 0x4($v0)
/* BDFCC 801278CC 24620008 */  addiu     $v0, $v1, 0x8
/* BDFD0 801278D0 AE220000 */  sw        $v0, 0x0($s1)
/* BDFD4 801278D4 24620010 */  addiu     $v0, $v1, 0x10
/* BDFD8 801278D8 AC760000 */  sw        $s6, 0x0($v1)
/* BDFDC 801278DC AC640004 */  sw        $a0, 0x4($v1)
/* BDFE0 801278E0 AE220000 */  sw        $v0, 0x0($s1)
/* BDFE4 801278E4 24620018 */  addiu     $v0, $v1, 0x18
/* BDFE8 801278E8 AC670008 */  sw        $a3, 0x8($v1)
/* BDFEC 801278EC AC66000C */  sw        $a2, 0xC($v1)
/* BDFF0 801278F0 AE220000 */  sw        $v0, 0x0($s1)
/* BDFF4 801278F4 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* BDFF8 801278F8 AC620010 */  sw        $v0, 0x10($v1)
/* BDFFC 801278FC 03B01021 */  addu      $v0, $sp, $s0
/* BE000 80127900 AC680014 */  sw        $t0, 0x14($v1)
/* BE004 80127904 90420028 */  lbu       $v0, 0x28($v0)
/* BE008 80127908 00101880 */  sll       $v1, $s0, 2
/* BE00C 8012790C 00570018 */  mult      $v0, $s7
/* BE010 80127910 03A31021 */  addu      $v0, $sp, $v1
/* BE014 80127914 8C460040 */  lw        $a2, 0x40($v0)
/* BE018 80127918 26870002 */  addiu     $a3, $s4, 0x2
/* BE01C 8012791C 24C60002 */  addiu     $a2, $a2, 0x2
/* BE020 80127920 00005012 */  mflo      $t2
/* BE024 80127924 0C049D30 */  jal       draw_digit
/* BE028 80127928 03CA2021 */   addu     $a0, $fp, $t2
/* BE02C 8012792C 8E220000 */  lw        $v0, 0x0($s1)
/* BE030 80127930 26100001 */  addiu     $s0, $s0, 0x1
/* BE034 80127934 0040182D */  daddu     $v1, $v0, $zero
/* BE038 80127938 24420008 */  addiu     $v0, $v0, 0x8
/* BE03C 8012793C AE220000 */  sw        $v0, 0x0($s1)
/* BE040 80127940 0213102A */  slt       $v0, $s0, $s3
/* BE044 80127944 AC720000 */  sw        $s2, 0x0($v1)
/* BE048 80127948 1440FFD1 */  bnez      $v0, .L80127890
/* BE04C 8012794C AC600004 */   sw       $zero, 0x4($v1)
.L80127950:
/* BE050 80127950 8FAA00DC */  lw        $t2, 0xDC($sp)
/* BE054 80127954 240200FF */  addiu     $v0, $zero, 0xFF
/* BE058 80127958 15420015 */  bne       $t2, $v0, .L801279B0
/* BE05C 8012795C 3C07E200 */   lui      $a3, (0xE200001C >> 16)
/* BE060 80127960 34E7001C */  ori       $a3, $a3, (0xE200001C & 0xFFFF)
/* BE064 80127964 3C050F0A */  lui       $a1, (0xF0A7008 >> 16)
/* BE068 80127968 34A57008 */  ori       $a1, $a1, (0xF0A7008 & 0xFFFF)
/* BE06C 8012796C 3C08FCFF */  lui       $t0, (0xFCFFFFFF >> 16)
/* BE070 80127970 3508FFFF */  ori       $t0, $t0, (0xFCFFFFFF & 0xFFFF)
/* BE074 80127974 3C06FFFC */  lui       $a2, (0xFFFCF279 >> 16)
/* BE078 80127978 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* BE07C 8012797C 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* BE080 80127980 8C820000 */  lw        $v0, 0x0($a0)
/* BE084 80127984 34C6F279 */  ori       $a2, $a2, (0xFFFCF279 & 0xFFFF)
/* BE088 80127988 0040182D */  daddu     $v1, $v0, $zero
/* BE08C 8012798C 24420008 */  addiu     $v0, $v0, 0x8
/* BE090 80127990 AC820000 */  sw        $v0, 0x0($a0)
/* BE094 80127994 AC670000 */  sw        $a3, 0x0($v1)
/* BE098 80127998 AC650004 */  sw        $a1, 0x4($v1)
/* BE09C 8012799C 24430008 */  addiu     $v1, $v0, 0x8
/* BE0A0 801279A0 AC830000 */  sw        $v1, 0x0($a0)
/* BE0A4 801279A4 AC480000 */  sw        $t0, 0x0($v0)
/* BE0A8 801279A8 08049E87 */  j         .L80127A1C
/* BE0AC 801279AC AC460004 */   sw       $a2, 0x4($v0)
.L801279B0:
/* BE0B0 801279B0 34E7001C */  ori       $a3, $a3, (0xE200001C & 0xFFFF)
/* BE0B4 801279B4 3C050050 */  lui       $a1, (0x504240 >> 16)
/* BE0B8 801279B8 34A54240 */  ori       $a1, $a1, (0x504240 & 0xFFFF)
/* BE0BC 801279BC 3C08FCFF */  lui       $t0, (0xFCFFB3FF >> 16)
/* BE0C0 801279C0 3508B3FF */  ori       $t0, $t0, (0xFCFFB3FF & 0xFFFF)
/* BE0C4 801279C4 3C06FF64 */  lui       $a2, (0xFF64FE7F >> 16)
/* BE0C8 801279C8 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* BE0CC 801279CC 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* BE0D0 801279D0 8C830000 */  lw        $v1, 0x0($a0)
/* BE0D4 801279D4 34C6FE7F */  ori       $a2, $a2, (0xFF64FE7F & 0xFFFF)
/* BE0D8 801279D8 0060102D */  daddu     $v0, $v1, $zero
/* BE0DC 801279DC 24630008 */  addiu     $v1, $v1, 0x8
/* BE0E0 801279E0 AC830000 */  sw        $v1, 0x0($a0)
/* BE0E4 801279E4 AC470000 */  sw        $a3, 0x0($v0)
/* BE0E8 801279E8 AC450004 */  sw        $a1, 0x4($v0)
/* BE0EC 801279EC 24620008 */  addiu     $v0, $v1, 0x8
/* BE0F0 801279F0 AC820000 */  sw        $v0, 0x0($a0)
/* BE0F4 801279F4 24620010 */  addiu     $v0, $v1, 0x10
/* BE0F8 801279F8 AC680000 */  sw        $t0, 0x0($v1)
/* BE0FC 801279FC AC660004 */  sw        $a2, 0x4($v1)
/* BE100 80127A00 AC820000 */  sw        $v0, 0x0($a0)
/* BE104 80127A04 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* BE108 80127A08 AC620008 */  sw        $v0, 0x8($v1)
/* BE10C 80127A0C 8FAA00DC */  lw        $t2, 0xDC($sp)
/* BE110 80127A10 2402FF00 */  addiu     $v0, $zero, -0x100
/* BE114 80127A14 01421025 */  or        $v0, $t2, $v0
/* BE118 80127A18 AC62000C */  sw        $v0, 0xC($v1)
.L80127A1C:
/* BE11C 80127A1C 3C07F500 */  lui       $a3, (0xF5000100 >> 16)
/* BE120 80127A20 34E70100 */  ori       $a3, $a3, (0xF5000100 & 0xFFFF)
/* BE124 80127A24 3C080703 */  lui       $t0, (0x703C000 >> 16)
/* BE128 80127A28 3508C000 */  ori       $t0, $t0, (0x703C000 & 0xFFFF)
/* BE12C 80127A2C 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* BE130 80127A30 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* BE134 80127A34 0000802D */  daddu     $s0, $zero, $zero
/* BE138 80127A38 8C830000 */  lw        $v1, 0x0($a0)
/* BE13C 80127A3C 3C02FD10 */  lui       $v0, (0xFD100000 >> 16)
/* BE140 80127A40 0060302D */  daddu     $a2, $v1, $zero
/* BE144 80127A44 24630008 */  addiu     $v1, $v1, 0x8
/* BE148 80127A48 AC830000 */  sw        $v1, 0x0($a0)
/* BE14C 80127A4C ACC20000 */  sw        $v0, 0x0($a2)
/* BE150 80127A50 8FA200D8 */  lw        $v0, 0xD8($sp)
/* BE154 80127A54 3C05802F */  lui       $a1, %hi(D_802F4560)
/* BE158 80127A58 24A54560 */  addiu     $a1, $a1, %lo(D_802F4560)
/* BE15C 80127A5C 00021100 */  sll       $v0, $v0, 4
/* BE160 80127A60 00451021 */  addu      $v0, $v0, $a1
/* BE164 80127A64 ACC20004 */  sw        $v0, 0x4($a2)
/* BE168 80127A68 24620008 */  addiu     $v0, $v1, 0x8
/* BE16C 80127A6C AC820000 */  sw        $v0, 0x0($a0)
/* BE170 80127A70 3C02E800 */  lui       $v0, (0xE8000000 >> 16)
/* BE174 80127A74 AC620000 */  sw        $v0, 0x0($v1)
/* BE178 80127A78 24620010 */  addiu     $v0, $v1, 0x10
/* BE17C 80127A7C AC600004 */  sw        $zero, 0x4($v1)
/* BE180 80127A80 AC820000 */  sw        $v0, 0x0($a0)
/* BE184 80127A84 3C020700 */  lui       $v0, (0x7000000 >> 16)
/* BE188 80127A88 AC62000C */  sw        $v0, 0xC($v1)
/* BE18C 80127A8C 24620018 */  addiu     $v0, $v1, 0x18
/* BE190 80127A90 AC670008 */  sw        $a3, 0x8($v1)
/* BE194 80127A94 AC820000 */  sw        $v0, 0x0($a0)
/* BE198 80127A98 3C02E600 */  lui       $v0, (0xE6000000 >> 16)
/* BE19C 80127A9C AC620010 */  sw        $v0, 0x10($v1)
/* BE1A0 80127AA0 24620020 */  addiu     $v0, $v1, 0x20
/* BE1A4 80127AA4 AC600014 */  sw        $zero, 0x14($v1)
/* BE1A8 80127AA8 AC820000 */  sw        $v0, 0x0($a0)
/* BE1AC 80127AAC 3C02F000 */  lui       $v0, (0xF0000000 >> 16)
/* BE1B0 80127AB0 AC620018 */  sw        $v0, 0x18($v1)
/* BE1B4 80127AB4 24620028 */  addiu     $v0, $v1, 0x28
/* BE1B8 80127AB8 AC68001C */  sw        $t0, 0x1C($v1)
/* BE1BC 80127ABC AC820000 */  sw        $v0, 0x0($a0)
/* BE1C0 80127AC0 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* BE1C4 80127AC4 AC620020 */  sw        $v0, 0x20($v1)
/* BE1C8 80127AC8 1A600014 */  blez      $s3, .L80127B1C
/* BE1CC 80127ACC AC600024 */   sw       $zero, 0x24($v1)
/* BE1D0 80127AD0 27B20028 */  addiu     $s2, $sp, 0x28
/* BE1D4 80127AD4 27B10040 */  addiu     $s1, $sp, 0x40
.L80127AD8:
/* BE1D8 80127AD8 8E260000 */  lw        $a2, 0x0($s1)
/* BE1DC 80127ADC 24C2FFFF */  addiu     $v0, $a2, -0x1
/* BE1E0 80127AE0 2C42013F */  sltiu     $v0, $v0, 0x13F
/* BE1E4 80127AE4 5040000A */  beql      $v0, $zero, .L80127B10
/* BE1E8 80127AE8 26100001 */   addiu    $s0, $s0, 0x1
/* BE1EC 80127AEC 02501021 */  addu      $v0, $s2, $s0
/* BE1F0 80127AF0 90420000 */  lbu       $v0, 0x0($v0)
/* BE1F4 80127AF4 00570018 */  mult      $v0, $s7
/* BE1F8 80127AF8 02A0282D */  daddu     $a1, $s5, $zero
/* BE1FC 80127AFC 0280382D */  daddu     $a3, $s4, $zero
/* BE200 80127B00 00005012 */  mflo      $t2
/* BE204 80127B04 0C049D30 */  jal       draw_digit
/* BE208 80127B08 03CA2021 */   addu     $a0, $fp, $t2
/* BE20C 80127B0C 26100001 */  addiu     $s0, $s0, 0x1
.L80127B10:
/* BE210 80127B10 0213102A */  slt       $v0, $s0, $s3
/* BE214 80127B14 1440FFF0 */  bnez      $v0, .L80127AD8
/* BE218 80127B18 26310004 */   addiu    $s1, $s1, 0x4
.L80127B1C:
/* BE21C 80127B1C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* BE220 80127B20 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* BE224 80127B24 8C620000 */  lw        $v0, 0x0($v1)
/* BE228 80127B28 0040202D */  daddu     $a0, $v0, $zero
/* BE22C 80127B2C 24420008 */  addiu     $v0, $v0, 0x8
/* BE230 80127B30 AC620000 */  sw        $v0, 0x0($v1)
/* BE234 80127B34 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* BE238 80127B38 AC820000 */  sw        $v0, 0x0($a0)
/* BE23C 80127B3C AC800004 */  sw        $zero, 0x4($a0)
.L80127B40:
/* BE240 80127B40 8FBF00C4 */  lw        $ra, 0xC4($sp)
/* BE244 80127B44 8FBE00C0 */  lw        $fp, 0xC0($sp)
/* BE248 80127B48 8FB700BC */  lw        $s7, 0xBC($sp)
/* BE24C 80127B4C 8FB600B8 */  lw        $s6, 0xB8($sp)
/* BE250 80127B50 8FB500B4 */  lw        $s5, 0xB4($sp)
/* BE254 80127B54 8FB400B0 */  lw        $s4, 0xB0($sp)
/* BE258 80127B58 8FB300AC */  lw        $s3, 0xAC($sp)
/* BE25C 80127B5C 8FB200A8 */  lw        $s2, 0xA8($sp)
/* BE260 80127B60 8FB100A4 */  lw        $s1, 0xA4($sp)
/* BE264 80127B64 8FB000A0 */  lw        $s0, 0xA0($sp)
/* BE268 80127B68 03E00008 */  jr        $ra
/* BE26C 80127B6C 27BD00C8 */   addiu    $sp, $sp, 0xC8

### DECOMPILED C INSTRUCTIONS:

void draw_number(s32 value, s32 x, s32 y, s32 charset, s32 palette, s32 opacity, u16 style) {
    u8 valueStr[24];
    u8 digits[24];
    s32 digitPosX[24];
    s32 i;
    s32 count;
    s32 posX;
    IMG_PTR raster = gMsgNumbers[charset].rasters;
    s32 texSize = gMsgNumbers[charset].texSize;

    y -= 2;
    if (y < 0 || y > 240) {
        return;
    }

    int_to_string(value, valueStr, 10);

    for (i = 0; i < 10; i++) {
        u8 digit;
        if (valueStr[i] == '\0') {
            break;
        }

        digit = valueStr[i] - '0';
        if (digit < 10){
            digits[i] = digit;
        }
    }
    posX = x;
    count = i;

    gSPDisplayList(gMainGfxPos++, gMsgDlistInitDrawNumber);

    if (style & DRAW_NUMBER_STYLE_ALIGN_RIGHT) {
        for (i = count - 1; i >= 0; i--) {
            if (style & DRAW_NUMBER_STYLE_MONOSPACE) {
                posX -= gMsgNumbers[charset].fixedWidth;
            } else {
                posX -= gMsgNumbers[charset].digitWidth[digits[i]];
            }
            digitPosX[i] = posX;
        }
    } else {
        for (i = 0; i < count; i++) {
            digitPosX[i] = posX;
            if (style & DRAW_NUMBER_STYLE_MONOSPACE) {
                posX += gMsgNumbers[charset].fixedWidth;
            } else {
                posX += gMsgNumbers[charset].digitWidth[digits[i]];
            }
        }
    }

    if (style & DRAW_NUMBER_STYLE_DROP_SHADOW) {
        for (i = 0; i < count; i++) {
            gDPPipeSync(gMainGfxPos++);
            gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
            gDPSetCombineMode(gMainGfxPos++, PM_CC_07, PM_CC_07);
            gDPSetPrimColor(gMainGfxPos++, 0, 0, 40, 40, 40, 72);
            draw_digit(raster + digits[i] * texSize, charset, digitPosX[i] + 2, y + 2);
            gDPPipeSync(gMainGfxPos++);
        }
    }

    if (opacity == 255) {
        gDPSetRenderMode(gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
        gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
    } else {
        gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
        gDPSetCombineMode(gMainGfxPos++, PM_CC_01, PM_CC_01);
        gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, opacity);
    }

    gDPLoadTLUT_pal16(gMainGfxPos++, 0, D_802F4560[palette]);
    for (i = 0; i < count; i++) {
        posX = digitPosX[i];
        if (posX > 0 && posX < 320) {
            draw_digit(raster + digits[i] * texSize, charset, posX, y);
        }
    }
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel shimmer_burst_update
/* 3742A4 E00701F4 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 3742A8 E00701F8 AFB20028 */  sw        $s2, 0x28($sp)
/* 3742AC E00701FC 0080902D */  daddu     $s2, $a0, $zero
/* 3742B0 E0070200 AFBF0034 */  sw        $ra, 0x34($sp)
/* 3742B4 E0070204 AFB40030 */  sw        $s4, 0x30($sp)
/* 3742B8 E0070208 AFB3002C */  sw        $s3, 0x2C($sp)
/* 3742BC E007020C AFB10024 */  sw        $s1, 0x24($sp)
/* 3742C0 E0070210 AFB00020 */  sw        $s0, 0x20($sp)
/* 3742C4 E0070214 F7BE0060 */  sdc1      $f30, 0x60($sp)
/* 3742C8 E0070218 F7BC0058 */  sdc1      $f28, 0x58($sp)
/* 3742CC E007021C F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 3742D0 E0070220 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3742D4 E0070224 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 3742D8 E0070228 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 3742DC E007022C 8E440000 */  lw        $a0, 0x0($s2)
/* 3742E0 E0070230 8E43000C */  lw        $v1, 0xC($s2)
/* 3742E4 E0070234 30820010 */  andi      $v0, $a0, 0x10
/* 3742E8 E0070238 8C740000 */  lw        $s4, 0x0($v1)
/* 3742EC E007023C 10400005 */  beqz      $v0, .LE0070254
/* 3742F0 E0070240 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3742F4 E0070244 00821024 */  and       $v0, $a0, $v0
/* 3742F8 E0070248 AE420000 */  sw        $v0, 0x0($s2)
/* 3742FC E007024C 24020010 */  addiu     $v0, $zero, 0x10
/* 374300 E0070250 AC620038 */  sw        $v0, 0x38($v1)
.LE0070254:
/* 374304 E0070254 8C640038 */  lw        $a0, 0x38($v1)
/* 374308 E0070258 288203E8 */  slti      $v0, $a0, 0x3E8
/* 37430C E007025C 10400002 */  beqz      $v0, .LE0070268
/* 374310 E0070260 2482FFFF */   addiu    $v0, $a0, -0x1
/* 374314 E0070264 AC620038 */  sw        $v0, 0x38($v1)
.LE0070268:
/* 374318 E0070268 8C62003C */  lw        $v0, 0x3C($v1)
/* 37431C E007026C 8C640038 */  lw        $a0, 0x38($v1)
/* 374320 E0070270 24420001 */  addiu     $v0, $v0, 0x1
/* 374324 E0070274 04810005 */  bgez      $a0, .LE007028C
/* 374328 E0070278 AC62003C */   sw       $v0, 0x3C($v1)
/* 37432C E007027C 0C080128 */  jal       shim_remove_effect
/* 374330 E0070280 0240202D */   daddu    $a0, $s2, $zero
/* 374334 E0070284 0801C1AE */  j         .LE00706B8
/* 374338 E0070288 00000000 */   nop
.LE007028C:
/* 37433C E007028C 28820008 */  slti      $v0, $a0, 0x8
/* 374340 E0070290 10400002 */  beqz      $v0, .LE007029C
/* 374344 E0070294 00041140 */   sll      $v0, $a0, 5
/* 374348 E0070298 AC62004C */  sw        $v0, 0x4C($v1)
.LE007029C:
/* 37434C E007029C C47A0010 */  lwc1      $f26, 0x10($v1)
/* 374350 E00702A0 C4780014 */  lwc1      $f24, 0x14($v1)
/* 374354 E00702A4 E7B80010 */  swc1      $f24, 0x10($sp)
/* 374358 E00702A8 8E420008 */  lw        $v0, 0x8($s2)
/* 37435C E00702AC 24110001 */  addiu     $s1, $zero, 0x1
/* 374360 E00702B0 0222102A */  slt       $v0, $s1, $v0
/* 374364 E00702B4 10400100 */  beqz      $v0, .LE00706B8
/* 374368 E00702B8 2463006C */   addiu    $v1, $v1, 0x6C
/* 37436C E00702BC 4600D60D */  trunc.w.s $f24, $f26
/* 374370 E00702C0 4413C000 */  mfc1      $s3, $f24
/* 374374 E00702C4 24700020 */  addiu     $s0, $v1, 0x20
/* 374378 E00702C8 3C01E007 */  lui       $at, (0xE0070D60 >> 16)
/* 37437C E00702CC D43E0D60 */  ldc1      $f30, (0xE0070D60 & 0xFFFF)($at)
/* 374380 E00702D0 3C01E007 */  lui       $at, (0xE0070D68 >> 16)
/* 374384 E00702D4 D43C0D68 */  ldc1      $f28, (0xE0070D68 & 0xFFFF)($at)
.LE00702D8:
/* 374388 E00702D8 8E020010 */  lw        $v0, 0x10($s0)
/* 37438C E00702DC 24420001 */  addiu     $v0, $v0, 0x1
/* 374390 E00702E0 AE020010 */  sw        $v0, 0x10($s0)
/* 374394 E00702E4 28420014 */  slti      $v0, $v0, 0x14
/* 374398 E00702E8 50400001 */  beql      $v0, $zero, .LE00702F0
/* 37439C E00702EC AE000010 */   sw       $zero, 0x10($s0)
.LE00702F0:
/* 3743A0 E00702F0 8E020010 */  lw        $v0, 0x10($s0)
/* 3743A4 E00702F4 044200EC */  bltzl     $v0, .LE00706A8
/* 3743A8 E00702F8 26310001 */   addiu    $s1, $s1, 0x1
/* 3743AC E00702FC 144000A6 */  bnez      $v0, .LE0070598
/* 3743B0 E0070300 00000000 */   nop
/* 3743B4 E0070304 0C080138 */  jal       shim_rand_int
/* 3743B8 E0070308 24040167 */   addiu    $a0, $zero, 0x167
/* 3743BC E007030C 24040167 */  addiu     $a0, $zero, 0x167
/* 3743C0 E0070310 4482C000 */  mtc1      $v0, $f24
/* 3743C4 E0070314 00000000 */  nop
/* 3743C8 E0070318 4680C620 */  cvt.s.w   $f24, $f24
/* 3743CC E007031C 0C080138 */  jal       shim_rand_int
/* 3743D0 E0070320 E7B80018 */   swc1     $f24, 0x18($sp)
/* 3743D4 E0070324 4482B000 */  mtc1      $v0, $f22
/* 3743D8 E0070328 00000000 */  nop
/* 3743DC E007032C 1680003F */  bnez      $s4, .LE007042C
/* 3743E0 E0070330 4680B5A0 */   cvt.s.w  $f22, $f22
/* 3743E4 E0070334 0C080140 */  jal       shim_sin_deg
/* 3743E8 E0070338 C7AC0018 */   lwc1     $f12, 0x18($sp)
/* 3743EC E007033C 4600B306 */  mov.s     $f12, $f22
/* 3743F0 E0070340 0C080144 */  jal       shim_cos_deg
/* 3743F4 E0070344 46000506 */   mov.s    $f20, $f0
/* 3743F8 E0070348 4614D502 */  mul.s     $f20, $f26, $f20
/* 3743FC E007034C 00000000 */  nop
/* 374400 E0070350 4600A502 */  mul.s     $f20, $f20, $f0
/* 374404 E0070354 00000000 */  nop
/* 374408 E0070358 C7AC0018 */  lwc1      $f12, 0x18($sp)
/* 37440C E007035C 0C080144 */  jal       shim_cos_deg
/* 374410 E0070360 E614FFE4 */   swc1     $f20, -0x1C($s0)
/* 374414 E0070364 4600B306 */  mov.s     $f12, $f22
/* 374418 E0070368 0C080144 */  jal       shim_cos_deg
/* 37441C E007036C 46000506 */   mov.s    $f20, $f0
/* 374420 E0070370 C7B80010 */  lwc1      $f24, 0x10($sp)
/* 374424 E0070374 4614C502 */  mul.s     $f20, $f24, $f20
/* 374428 E0070378 00000000 */  nop
/* 37442C E007037C 4600A502 */  mul.s     $f20, $f20, $f0
/* 374430 E0070380 00000000 */  nop
/* 374434 E0070384 4600B306 */  mov.s     $f12, $f22
/* 374438 E0070388 0C080140 */  jal       shim_sin_deg
/* 37443C E007038C E614FFE8 */   swc1     $f20, -0x18($s0)
/* 374440 E0070390 C602FFE4 */  lwc1      $f2, -0x1C($s0)
/* 374444 E0070394 3C01E007 */  lui       $at, (0xE0070D70 >> 16)
/* 374448 E0070398 D4380D70 */  ldc1      $f24, (0xE0070D70 & 0xFFFF)($at)
/* 37444C E007039C 460010A1 */  cvt.d.s   $f2, $f2
/* 374450 E00703A0 46381082 */  mul.d     $f2, $f2, $f24
/* 374454 E00703A4 00000000 */  nop
/* 374458 E00703A8 C604FFE8 */  lwc1      $f4, -0x18($s0)
/* 37445C E00703AC 46002121 */  cvt.d.s   $f4, $f4
/* 374460 E00703B0 46382102 */  mul.d     $f4, $f4, $f24
/* 374464 E00703B4 00000000 */  nop
/* 374468 E00703B8 4600D002 */  mul.s     $f0, $f26, $f0
/* 37446C E00703BC 00000000 */  nop
/* 374470 E00703C0 E600FFEC */  swc1      $f0, -0x14($s0)
/* 374474 E00703C4 46000021 */  cvt.d.s   $f0, $f0
/* 374478 E00703C8 46380002 */  mul.d     $f0, $f0, $f24
/* 37447C E00703CC 00000000 */  nop
/* 374480 E00703D0 3C01E007 */  lui       $at, (0xE0070D78 >> 16)
/* 374484 E00703D4 D4380D78 */  ldc1      $f24, (0xE0070D78 & 0xFFFF)($at)
/* 374488 E00703D8 462010A0 */  cvt.s.d   $f2, $f2
/* 37448C E00703DC E602FFF8 */  swc1      $f2, -0x8($s0)
/* 374490 E00703E0 46001186 */  mov.s     $f6, $f2
/* 374494 E00703E4 460031A1 */  cvt.d.s   $f6, $f6
/* 374498 E00703E8 46383182 */  mul.d     $f6, $f6, $f24
/* 37449C E00703EC 00000000 */  nop
/* 3744A0 E00703F0 46202120 */  cvt.s.d   $f4, $f4
/* 3744A4 E00703F4 E604FFFC */  swc1      $f4, -0x4($s0)
/* 3744A8 E00703F8 46002086 */  mov.s     $f2, $f4
/* 3744AC E00703FC 460010A1 */  cvt.d.s   $f2, $f2
/* 3744B0 E0070400 46381082 */  mul.d     $f2, $f2, $f24
/* 3744B4 E0070404 00000000 */  nop
/* 3744B8 E0070408 46200020 */  cvt.s.d   $f0, $f0
/* 3744BC E007040C E6000000 */  swc1      $f0, 0x0($s0)
/* 3744C0 E0070410 46000021 */  cvt.d.s   $f0, $f0
/* 3744C4 E0070414 46380002 */  mul.d     $f0, $f0, $f24
/* 3744C8 E0070418 00000000 */  nop
/* 3744CC E007041C 462031A0 */  cvt.s.d   $f6, $f6
/* 3744D0 E0070420 462010A0 */  cvt.s.d   $f2, $f2
/* 3744D4 E0070424 0801C154 */  j         .LE0070550
/* 3744D8 E0070428 E6060004 */   swc1     $f6, 0x4($s0)
.LE007042C:
/* 3744DC E007042C 0C080138 */  jal       shim_rand_int
/* 3744E0 E0070430 0260202D */   daddu    $a0, $s3, $zero
/* 3744E4 E0070434 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3744E8 E0070438 4481C800 */  mtc1      $at, $f25
/* 3744EC E007043C 4480C000 */  mtc1      $zero, $f24
/* 3744F0 E0070440 4600D521 */  cvt.d.s   $f20, $f26
/* 3744F4 E0070444 4638A502 */  mul.d     $f20, $f20, $f24
/* 3744F8 E0070448 00000000 */  nop
/* 3744FC E007044C 44820000 */  mtc1      $v0, $f0
/* 374500 E0070450 00000000 */  nop
/* 374504 E0070454 46800021 */  cvt.d.w   $f0, $f0
/* 374508 E0070458 C7B80010 */  lwc1      $f24, 0x10($sp)
/* 37450C E007045C 46340001 */  sub.d     $f0, $f0, $f20
/* 374510 E0070460 4600C60D */  trunc.w.s $f24, $f24
/* 374514 E0070464 4404C000 */  mfc1      $a0, $f24
/* 374518 E0070468 46200020 */  cvt.s.d   $f0, $f0
/* 37451C E007046C 0C080138 */  jal       shim_rand_int
/* 374520 E0070470 E600FFE4 */   swc1     $f0, -0x1C($s0)
/* 374524 E0070474 C7B80010 */  lwc1      $f24, 0x10($sp)
/* 374528 E0070478 4600C0A1 */  cvt.d.s   $f2, $f24
/* 37452C E007047C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 374530 E0070480 4481C800 */  mtc1      $at, $f25
/* 374534 E0070484 4480C000 */  mtc1      $zero, $f24
/* 374538 E0070488 00000000 */  nop
/* 37453C E007048C 46381082 */  mul.d     $f2, $f2, $f24
/* 374540 E0070490 00000000 */  nop
/* 374544 E0070494 44820000 */  mtc1      $v0, $f0
/* 374548 E0070498 00000000 */  nop
/* 37454C E007049C 46800021 */  cvt.d.w   $f0, $f0
/* 374550 E00704A0 46220001 */  sub.d     $f0, $f0, $f2
/* 374554 E00704A4 0260202D */  daddu     $a0, $s3, $zero
/* 374558 E00704A8 46200020 */  cvt.s.d   $f0, $f0
/* 37455C E00704AC 0C080138 */  jal       shim_rand_int
/* 374560 E00704B0 E600FFE8 */   swc1     $f0, -0x18($s0)
/* 374564 E00704B4 C602FFE4 */  lwc1      $f2, -0x1C($s0)
/* 374568 E00704B8 3C01E007 */  lui       $at, (0xE0070D80 >> 16)
/* 37456C E00704BC D4380D80 */  ldc1      $f24, (0xE0070D80 & 0xFFFF)($at)
/* 374570 E00704C0 460010A1 */  cvt.d.s   $f2, $f2
/* 374574 E00704C4 46381082 */  mul.d     $f2, $f2, $f24
/* 374578 E00704C8 00000000 */  nop
/* 37457C E00704CC C606FFE8 */  lwc1      $f6, -0x18($s0)
/* 374580 E00704D0 460031A1 */  cvt.d.s   $f6, $f6
/* 374584 E00704D4 46383182 */  mul.d     $f6, $f6, $f24
/* 374588 E00704D8 00000000 */  nop
/* 37458C E00704DC 44820000 */  mtc1      $v0, $f0
/* 374590 E00704E0 00000000 */  nop
/* 374594 E00704E4 46800021 */  cvt.d.w   $f0, $f0
/* 374598 E00704E8 46340001 */  sub.d     $f0, $f0, $f20
/* 37459C E00704EC 46200020 */  cvt.s.d   $f0, $f0
/* 3745A0 E00704F0 E600FFEC */  swc1      $f0, -0x14($s0)
/* 3745A4 E00704F4 46000021 */  cvt.d.s   $f0, $f0
/* 3745A8 E00704F8 46380002 */  mul.d     $f0, $f0, $f24
/* 3745AC E00704FC 00000000 */  nop
/* 3745B0 E0070500 462010A0 */  cvt.s.d   $f2, $f2
/* 3745B4 E0070504 E602FFF8 */  swc1      $f2, -0x8($s0)
/* 3745B8 E0070508 46001106 */  mov.s     $f4, $f2
/* 3745BC E007050C 46002121 */  cvt.d.s   $f4, $f4
/* 3745C0 E0070510 463E2102 */  mul.d     $f4, $f4, $f30
/* 3745C4 E0070514 00000000 */  nop
/* 3745C8 E0070518 462031A0 */  cvt.s.d   $f6, $f6
/* 3745CC E007051C E606FFFC */  swc1      $f6, -0x4($s0)
/* 3745D0 E0070520 46003086 */  mov.s     $f2, $f6
/* 3745D4 E0070524 460010A1 */  cvt.d.s   $f2, $f2
/* 3745D8 E0070528 463E1082 */  mul.d     $f2, $f2, $f30
/* 3745DC E007052C 00000000 */  nop
/* 3745E0 E0070530 46200020 */  cvt.s.d   $f0, $f0
/* 3745E4 E0070534 E6000000 */  swc1      $f0, 0x0($s0)
/* 3745E8 E0070538 46000021 */  cvt.d.s   $f0, $f0
/* 3745EC E007053C 463E0002 */  mul.d     $f0, $f0, $f30
/* 3745F0 E0070540 00000000 */  nop
/* 3745F4 E0070544 46202120 */  cvt.s.d   $f4, $f4
/* 3745F8 E0070548 462010A0 */  cvt.s.d   $f2, $f2
/* 3745FC E007054C E6040004 */  swc1      $f4, 0x4($s0)
.LE0070550:
/* 374600 E0070550 E6020008 */  swc1      $f2, 0x8($s0)
/* 374604 E0070554 46200020 */  cvt.s.d   $f0, $f0
/* 374608 E0070558 E600000C */  swc1      $f0, 0xC($s0)
/* 37460C E007055C 0C080138 */  jal       shim_rand_int
/* 374610 E0070560 2404000F */   addiu    $a0, $zero, 0xF
/* 374614 E0070564 2404000F */  addiu     $a0, $zero, 0xF
/* 374618 E0070568 44820000 */  mtc1      $v0, $f0
/* 37461C E007056C 00000000 */  nop
/* 374620 E0070570 46800020 */  cvt.s.w   $f0, $f0
/* 374624 E0070574 0C080138 */  jal       shim_rand_int
/* 374628 E0070578 E6000044 */   swc1     $f0, 0x44($s0)
/* 37462C E007057C 44820000 */  mtc1      $v0, $f0
/* 374630 E0070580 00000000 */  nop
/* 374634 E0070584 46800020 */  cvt.s.w   $f0, $f0
/* 374638 E0070588 240200FF */  addiu     $v0, $zero, 0xFF
/* 37463C E007058C E6000048 */  swc1      $f0, 0x48($s0)
/* 374640 E0070590 AE000014 */  sw        $zero, 0x14($s0)
/* 374644 E0070594 AE02002C */  sw        $v0, 0x2C($s0)
.LE0070598:
/* 374648 E0070598 C610FFF8 */  lwc1      $f16, -0x8($s0)
/* 37464C E007059C C60A0004 */  lwc1      $f10, 0x4($s0)
/* 374650 E00705A0 46105281 */  sub.s     $f10, $f10, $f16
/* 374654 E00705A4 460052A1 */  cvt.d.s   $f10, $f10
/* 374658 E00705A8 463C5282 */  mul.d     $f10, $f10, $f28
/* 37465C E00705AC 00000000 */  nop
/* 374660 E00705B0 C60EFFFC */  lwc1      $f14, -0x4($s0)
/* 374664 E00705B4 C60C0008 */  lwc1      $f12, 0x8($s0)
/* 374668 E00705B8 460E6301 */  sub.s     $f12, $f12, $f14
/* 37466C E00705BC 46006321 */  cvt.d.s   $f12, $f12
/* 374670 E00705C0 463C6302 */  mul.d     $f12, $f12, $f28
/* 374674 E00705C4 00000000 */  nop
/* 374678 E00705C8 C6060000 */  lwc1      $f6, 0x0($s0)
/* 37467C E00705CC C608000C */  lwc1      $f8, 0xC($s0)
/* 374680 E00705D0 46064201 */  sub.s     $f8, $f8, $f6
/* 374684 E00705D4 46004221 */  cvt.d.s   $f8, $f8
/* 374688 E00705D8 463C4202 */  mul.d     $f8, $f8, $f28
/* 37468C E00705DC 00000000 */  nop
/* 374690 E00705E0 8E020010 */  lw        $v0, 0x10($s0)
/* 374694 E00705E4 C6160014 */  lwc1      $f22, 0x14($s0)
/* 374698 E00705E8 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 37469C E00705EC 44810000 */  mtc1      $at, $f0
/* 3746A0 E00705F0 C604FFE4 */  lwc1      $f4, -0x1C($s0)
/* 3746A4 E00705F4 C614FFE8 */  lwc1      $f20, -0x18($s0)
/* 3746A8 E00705F8 C612FFEC */  lwc1      $f18, -0x14($s0)
/* 3746AC E00705FC 4600B580 */  add.s     $f22, $f22, $f0
/* 3746B0 E0070600 00021080 */  sll       $v0, $v0, 2
/* 3746B4 E0070604 46008006 */  mov.s     $f0, $f16
/* 3746B8 E0070608 46002100 */  add.s     $f4, $f4, $f0
/* 3746BC E007060C 46007006 */  mov.s     $f0, $f14
/* 3746C0 E0070610 46008421 */  cvt.d.s   $f16, $f16
/* 3746C4 E0070614 3C01E007 */  lui       $at, (0xE0070CF0 >> 16)
/* 3746C8 E0070618 00220821 */  addu      $at, $at, $v0
/* 3746CC E007061C C4220CF0 */  lwc1      $f2, (0xE0070CF0 & 0xFFFF)($at)
/* 3746D0 E0070620 4600A500 */  add.s     $f20, $f20, $f0
/* 3746D4 E0070624 E6020040 */  swc1      $f2, 0x40($s0)
/* 3746D8 E0070628 46003086 */  mov.s     $f2, $f6
/* 3746DC E007062C 46029480 */  add.s     $f18, $f18, $f2
/* 3746E0 E0070630 C6020044 */  lwc1      $f2, 0x44($s0)
/* 3746E4 E0070634 3C01E007 */  lui       $at, (0xE0070D88 >> 16)
/* 3746E8 E0070638 D4200D88 */  ldc1      $f0, (0xE0070D88 & 0xFFFF)($at)
/* 3746EC E007063C 460010A1 */  cvt.d.s   $f2, $f2
/* 3746F0 E0070640 46201080 */  add.d     $f2, $f2, $f0
/* 3746F4 E0070644 C6000048 */  lwc1      $f0, 0x48($s0)
/* 3746F8 E0070648 460073A1 */  cvt.d.s   $f14, $f14
/* 3746FC E007064C E604FFE4 */  swc1      $f4, -0x1C($s0)
/* 374700 E0070650 3C01E007 */  lui       $at, (0xE0070D90 >> 16)
/* 374704 E0070654 D4240D90 */  ldc1      $f4, (0xE0070D90 & 0xFFFF)($at)
/* 374708 E0070658 460031A1 */  cvt.d.s   $f6, $f6
/* 37470C E007065C E6160014 */  swc1      $f22, 0x14($s0)
/* 374710 E0070660 46000021 */  cvt.d.s   $f0, $f0
/* 374714 E0070664 46240000 */  add.d     $f0, $f0, $f4
/* 374718 E0070668 E614FFE8 */  swc1      $f20, -0x18($s0)
/* 37471C E007066C E612FFEC */  swc1      $f18, -0x14($s0)
/* 374720 E0070670 462A8400 */  add.d     $f16, $f16, $f10
/* 374724 E0070674 462010A0 */  cvt.s.d   $f2, $f2
/* 374728 E0070678 E6020044 */  swc1      $f2, 0x44($s0)
/* 37472C E007067C 462C7380 */  add.d     $f14, $f14, $f12
/* 374730 E0070680 46200020 */  cvt.s.d   $f0, $f0
/* 374734 E0070684 E6000048 */  swc1      $f0, 0x48($s0)
/* 374738 E0070688 46283180 */  add.d     $f6, $f6, $f8
/* 37473C E007068C 46208420 */  cvt.s.d   $f16, $f16
/* 374740 E0070690 462073A0 */  cvt.s.d   $f14, $f14
/* 374744 E0070694 462031A0 */  cvt.s.d   $f6, $f6
/* 374748 E0070698 E610FFF8 */  swc1      $f16, -0x8($s0)
/* 37474C E007069C E60EFFFC */  swc1      $f14, -0x4($s0)
/* 374750 E00706A0 E6060000 */  swc1      $f6, 0x0($s0)
/* 374754 E00706A4 26310001 */  addiu     $s1, $s1, 0x1
.LE00706A8:
/* 374758 E00706A8 8E420008 */  lw        $v0, 0x8($s2)
/* 37475C E00706AC 0222102A */  slt       $v0, $s1, $v0
/* 374760 E00706B0 1440FF09 */  bnez      $v0, .LE00702D8
/* 374764 E00706B4 2610006C */   addiu    $s0, $s0, 0x6C
.LE00706B8:
/* 374768 E00706B8 8FBF0034 */  lw        $ra, 0x34($sp)
/* 37476C E00706BC 8FB40030 */  lw        $s4, 0x30($sp)
/* 374770 E00706C0 8FB3002C */  lw        $s3, 0x2C($sp)
/* 374774 E00706C4 8FB20028 */  lw        $s2, 0x28($sp)
/* 374778 E00706C8 8FB10024 */  lw        $s1, 0x24($sp)
/* 37477C E00706CC 8FB00020 */  lw        $s0, 0x20($sp)
/* 374780 E00706D0 D7BE0060 */  ldc1      $f30, 0x60($sp)
/* 374784 E00706D4 D7BC0058 */  ldc1      $f28, 0x58($sp)
/* 374788 E00706D8 D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 37478C E00706DC D7B80048 */  ldc1      $f24, 0x48($sp)
/* 374790 E00706E0 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 374794 E00706E4 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 374798 E00706E8 03E00008 */  jr        $ra
/* 37479C E00706EC 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

void shimmer_burst_update(EffectInstance* effect) {
    ShimmerBurstFXData* part = effect->data.shimmerBurst;
    s32 unk_00 = part->unk_00;
    f32 unk_10;
    f32 unk_14;
    s32 i;

    if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
        effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
        part->unk_38 = 16;
    }

    if (part->unk_38 < 1000) {
        part->unk_38--;
    }

    part->unk_3C++;

    if (part->unk_38 < 0) {
        shim_remove_effect(effect);
        return;
    }

    if (part->unk_38 < 8) {
        part->unk_4C = part->unk_38 * 32;
    }

    unk_10 = part->unk_10;
    unk_14 = part->unk_14;

    part++;
    for (i = 1; i < effect->numParts; i++, part++) {
        part->unk_30++;
        if (part->unk_30 >= ARRAY_COUNT(D_E0070CF0)) {
            part->unk_30 = 0;
        }

        if (part->unk_30 >= 0) {
            if (part->unk_30 == 0) {
                f32 rand1 = shim_rand_int(359);
                f32 rand2 = shim_rand_int(359);

                if (unk_00 == 0) {
                    part->unk_04 = unk_10 * shim_sin_deg(rand1) * shim_cos_deg(rand2);
                    part->unk_08 = unk_14 * shim_cos_deg(rand1) * shim_cos_deg(rand2);
                    part->unk_0C = unk_10 * shim_sin_deg(rand2);
                    part->unk_18 = part->unk_04 * 0.4;
                    part->unk_1C = part->unk_08 * 0.4;
                    part->unk_20 = part->unk_0C * 0.4;
                    part->unk_24 = part->unk_18 * 0.1;
                    part->unk_28 = part->unk_1C * 0.1;
                    part->unk_2C = part->unk_20 * 0.1;
                } else {
                    part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5;
                    part->unk_08 = shim_rand_int(unk_14) - unk_14 * 0.5;
                    part->unk_0C = shim_rand_int(unk_10) - unk_10 * 0.5;
                    part->unk_18 = part->unk_04 * 0.3;
                    part->unk_1C = part->unk_08 * 0.3;
                    part->unk_20 = part->unk_0C * 0.3;
                    part->unk_24 = part->unk_18 * 0.02;
                    part->unk_28 = part->unk_1C * 0.02;
                    part->unk_2C = part->unk_20 * 0.02;
                }

                part->unk_64 = shim_rand_int(15);
                part->unk_68 = shim_rand_int(15);
                part->unk_34 = 0.0f;
                part->unk_4C = 255;
            }

            part->unk_60 = D_E0070CF0[part->unk_30];
            part->unk_34 += 4.0f;
            part->unk_04 += part->unk_18;
            part->unk_08 += part->unk_1C;
            part->unk_0C += part->unk_20;
            part->unk_64 += 0.2;
            part->unk_68 += 0.6;
            part->unk_18 += (part->unk_24 - part->unk_18) * 0.04;
            part->unk_1C += (part->unk_28 - part->unk_1C) * 0.04;
            part->unk_20 += (part->unk_2C - part->unk_20) * 0.04;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_draw_palswap_mode_2
/* 16E60 8003BA60 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 16E64 8003BA64 AFB30024 */  sw        $s3, 0x24($sp)
/* 16E68 8003BA68 0080982D */  daddu     $s3, $a0, $zero
/* 16E6C 8003BA6C AFB60030 */  sw        $s6, 0x30($sp)
/* 16E70 8003BA70 00A0B02D */  daddu     $s6, $a1, $zero
/* 16E74 8003BA74 AFB40028 */  sw        $s4, 0x28($sp)
/* 16E78 8003BA78 00C0A02D */  daddu     $s4, $a2, $zero
/* 16E7C 8003BA7C AFBF0038 */  sw        $ra, 0x38($sp)
/* 16E80 8003BA80 AFB70034 */  sw        $s7, 0x34($sp)
/* 16E84 8003BA84 AFB5002C */  sw        $s5, 0x2C($sp)
/* 16E88 8003BA88 AFB20020 */  sw        $s2, 0x20($sp)
/* 16E8C 8003BA8C AFB1001C */  sw        $s1, 0x1C($sp)
/* 16E90 8003BA90 AFB00018 */  sw        $s0, 0x18($sp)
/* 16E94 8003BA94 826200B6 */  lb        $v0, 0xB6($s3)
/* 16E98 8003BA98 10400049 */  beqz      $v0, .L8003BBC0
/* 16E9C 8003BA9C 00E0B82D */   daddu    $s7, $a3, $zero
/* 16EA0 8003BAA0 8E620000 */  lw        $v0, 0x0($s3)
/* 16EA4 8003BAA4 3C034000 */  lui       $v1, (0x40000000 >> 16)
/* 16EA8 8003BAA8 00431024 */  and       $v0, $v0, $v1
/* 16EAC 8003BAAC 14400004 */  bnez      $v0, .L8003BAC0
/* 16EB0 8003BAB0 00000000 */   nop
/* 16EB4 8003BAB4 0C0B7A90 */  jal       spr_get_npc_palettes
/* 16EB8 8003BAB8 96640028 */   lhu      $a0, 0x28($s3)
/* 16EBC 8003BABC AE6200C4 */  sw        $v0, 0xC4($s3)
.L8003BAC0:
/* 16EC0 8003BAC0 8E6400C4 */  lw        $a0, 0xC4($s3)
/* 16EC4 8003BAC4 A26000C1 */  sb        $zero, 0xC1($s3)
/* 16EC8 8003BAC8 8C830000 */  lw        $v1, 0x0($a0)
/* 16ECC 8003BACC 2402FFFF */  addiu     $v0, $zero, -0x1
/* 16ED0 8003BAD0 1062000B */  beq       $v1, $v0, .L8003BB00
/* 16ED4 8003BAD4 0080182D */   daddu    $v1, $a0, $zero
/* 16ED8 8003BAD8 0040202D */  daddu     $a0, $v0, $zero
.L8003BADC:
/* 16EDC 8003BADC 926200C1 */  lbu       $v0, 0xC1($s3)
/* 16EE0 8003BAE0 24420001 */  addiu     $v0, $v0, 0x1
/* 16EE4 8003BAE4 A26200C1 */  sb        $v0, 0xC1($s3)
/* 16EE8 8003BAE8 00021600 */  sll       $v0, $v0, 24
/* 16EEC 8003BAEC 00021583 */  sra       $v0, $v0, 22
/* 16EF0 8003BAF0 00431021 */  addu      $v0, $v0, $v1
/* 16EF4 8003BAF4 8C420000 */  lw        $v0, 0x0($v0)
/* 16EF8 8003BAF8 1444FFF8 */  bne       $v0, $a0, .L8003BADC
/* 16EFC 8003BAFC 00000000 */   nop
.L8003BB00:
/* 16F00 8003BB00 826300B6 */  lb        $v1, 0xB6($s3)
/* 16F04 8003BB04 24020001 */  addiu     $v0, $zero, 0x1
/* 16F08 8003BB08 14620004 */  bne       $v1, $v0, .L8003BB1C
/* 16F0C 8003BB0C 240200FF */   addiu    $v0, $zero, 0xFF
/* 16F10 8003BB10 A26000B7 */  sb        $zero, 0xB7($s3)
/* 16F14 8003BB14 0800EEC9 */  j         .L8003BB24
/* 16F18 8003BB18 A66000BE */   sh       $zero, 0xBE($s3)
.L8003BB1C:
/* 16F1C 8003BB1C A26000B7 */  sb        $zero, 0xB7($s3)
/* 16F20 8003BB20 A66200BE */  sh        $v0, 0xBE($s3)
.L8003BB24:
/* 16F24 8003BB24 826200C1 */  lb        $v0, 0xC1($s3)
/* 16F28 8003BB28 18400018 */  blez      $v0, .L8003BB8C
/* 16F2C 8003BB2C 0000202D */   daddu    $a0, $zero, $zero
/* 16F30 8003BB30 0260302D */  daddu     $a2, $s3, $zero
/* 16F34 8003BB34 240500C8 */  addiu     $a1, $zero, 0xC8
.L8003BB38:
/* 16F38 8003BB38 8E6300C4 */  lw        $v1, 0xC4($s3)
/* 16F3C 8003BB3C 00041080 */  sll       $v0, $a0, 2
/* 16F40 8003BB40 00431021 */  addu      $v0, $v0, $v1
/* 16F44 8003BB44 8C520000 */  lw        $s2, 0x0($v0)
/* 16F48 8003BB48 02658821 */  addu      $s1, $s3, $a1
/* 16F4C 8003BB4C 12400009 */  beqz      $s2, .L8003BB74
/* 16F50 8003BB50 ACD102C8 */   sw       $s1, 0x2C8($a2)
/* 16F54 8003BB54 0000802D */  daddu     $s0, $zero, $zero
.L8003BB58:
/* 16F58 8003BB58 96420000 */  lhu       $v0, 0x0($s2)
/* 16F5C 8003BB5C 26520002 */  addiu     $s2, $s2, 0x2
/* 16F60 8003BB60 26100001 */  addiu     $s0, $s0, 0x1
/* 16F64 8003BB64 A6220000 */  sh        $v0, 0x0($s1)
/* 16F68 8003BB68 2A020010 */  slti      $v0, $s0, 0x10
/* 16F6C 8003BB6C 1440FFFA */  bnez      $v0, .L8003BB58
/* 16F70 8003BB70 26310002 */   addiu    $s1, $s1, 0x2
.L8003BB74:
/* 16F74 8003BB74 24C60004 */  addiu     $a2, $a2, 0x4
/* 16F78 8003BB78 826200C1 */  lb        $v0, 0xC1($s3)
/* 16F7C 8003BB7C 24840001 */  addiu     $a0, $a0, 0x1
/* 16F80 8003BB80 0082102A */  slt       $v0, $a0, $v0
/* 16F84 8003BB84 1440FFEC */  bnez      $v0, .L8003BB38
/* 16F88 8003BB88 24A50020 */   addiu    $a1, $a1, 0x20
.L8003BB8C:
/* 16F8C 8003BB8C 16800007 */  bnez      $s4, .L8003BBAC
/* 16F90 8003BB90 00000000 */   nop
/* 16F94 8003BB94 9662030C */  lhu       $v0, 0x30C($s3)
/* 16F98 8003BB98 A660030C */  sh        $zero, 0x30C($s3)
/* 16F9C 8003BB9C A662030E */  sh        $v0, 0x30E($s3)
/* 16FA0 8003BBA0 0040182D */  daddu     $v1, $v0, $zero
/* 16FA4 8003BBA4 A6620310 */  sh        $v0, 0x310($s3)
/* 16FA8 8003BBA8 A6630312 */  sh        $v1, 0x312($s3)
.L8003BBAC:
/* 16FAC 8003BBAC 9662030C */  lhu       $v0, 0x30C($s3)
/* 16FB0 8003BBB0 A66000BE */  sh        $zero, 0xBE($s3)
/* 16FB4 8003BBB4 A26000B7 */  sb        $zero, 0xB7($s3)
/* 16FB8 8003BBB8 A26000B6 */  sb        $zero, 0xB6($s3)
/* 16FBC 8003BBBC A66200BC */  sh        $v0, 0xBC($s3)
.L8003BBC0:
/* 16FC0 8003BBC0 826300B7 */  lb        $v1, 0xB7($s3)
/* 16FC4 8003BBC4 10600005 */  beqz      $v1, .L8003BBDC
/* 16FC8 8003BBC8 24020001 */   addiu    $v0, $zero, 0x1
/* 16FCC 8003BBCC 1062000C */  beq       $v1, $v0, .L8003BC00
/* 16FD0 8003BBD0 24020002 */   addiu    $v0, $zero, 0x2
/* 16FD4 8003BBD4 0800EF40 */  j         .L8003BD00
/* 16FD8 8003BBD8 00000000 */   nop
.L8003BBDC:
/* 16FDC 8003BBDC 866200BC */  lh        $v0, 0xBC($s3)
/* 16FE0 8003BBE0 966300BC */  lhu       $v1, 0xBC($s3)
/* 16FE4 8003BBE4 10400003 */  beqz      $v0, .L8003BBF4
/* 16FE8 8003BBE8 2462FFFF */   addiu    $v0, $v1, -0x1
/* 16FEC 8003BBEC 0800EF3E */  j         .L8003BCF8
/* 16FF0 8003BBF0 A66200BC */   sh       $v0, 0xBC($s3)
.L8003BBF4:
/* 16FF4 8003BBF4 24020001 */  addiu     $v0, $zero, 0x1
/* 16FF8 8003BBF8 A66000BE */  sh        $zero, 0xBE($s3)
/* 16FFC 8003BBFC A26200B7 */  sb        $v0, 0xB7($s3)
.L8003BC00:
/* 17000 8003BC00 8662030E */  lh        $v0, 0x30E($s3)
/* 17004 8003BC04 24036400 */  addiu     $v1, $zero, 0x6400
/* 17008 8003BC08 14400002 */  bnez      $v0, .L8003BC14
/* 1700C 8003BC0C 0062001A */   div      $zero, $v1, $v0
/* 17010 8003BC10 0007000D */  break     7
.L8003BC14:
/* 17014 8003BC14 2401FFFF */  addiu     $at, $zero, -0x1
/* 17018 8003BC18 14410004 */  bne       $v0, $at, .L8003BC2C
/* 1701C 8003BC1C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 17020 8003BC20 14610002 */  bne       $v1, $at, .L8003BC2C
/* 17024 8003BC24 00000000 */   nop
/* 17028 8003BC28 0006000D */  break     6
.L8003BC2C:
/* 1702C 8003BC2C 00001812 */  mflo      $v1
/* 17030 8003BC30 966200BE */  lhu       $v0, 0xBE($s3)
/* 17034 8003BC34 00431021 */  addu      $v0, $v0, $v1
/* 17038 8003BC38 A66200BE */  sh        $v0, 0xBE($s3)
/* 1703C 8003BC3C 00021400 */  sll       $v0, $v0, 16
/* 17040 8003BC40 00021403 */  sra       $v0, $v0, 16
/* 17044 8003BC44 2842639D */  slti      $v0, $v0, 0x639D
/* 17048 8003BC48 14400003 */  bnez      $v0, .L8003BC58
/* 1704C 8003BC4C 3C0651EB */   lui      $a2, (0x51EB851F >> 16)
/* 17050 8003BC50 2402639C */  addiu     $v0, $zero, 0x639C
/* 17054 8003BC54 A66200BE */  sh        $v0, 0xBE($s3)
.L8003BC58:
/* 17058 8003BC58 34C6851F */  ori       $a2, $a2, (0x51EB851F & 0xFFFF)
/* 1705C 8003BC5C 267400C8 */  addiu     $s4, $s3, 0xC8
/* 17060 8003BC60 0000802D */  daddu     $s0, $zero, $zero
/* 17064 8003BC64 86620308 */  lh        $v0, 0x308($s3)
/* 17068 8003BC68 8E6500C4 */  lw        $a1, 0xC4($s3)
/* 1706C 8003BC6C 966300BE */  lhu       $v1, 0xBE($s3)
/* 17070 8003BC70 00021080 */  sll       $v0, $v0, 2
/* 17074 8003BC74 00451021 */  addu      $v0, $v0, $a1
/* 17078 8003BC78 00031C00 */  sll       $v1, $v1, 16
/* 1707C 8003BC7C 00032403 */  sra       $a0, $v1, 16
/* 17080 8003BC80 8C520000 */  lw        $s2, 0x0($v0)
/* 17084 8003BC84 8662030A */  lh        $v0, 0x30A($s3)
/* 17088 8003BC88 00860018 */  mult      $a0, $a2
/* 1708C 8003BC8C 00021080 */  sll       $v0, $v0, 2
/* 17090 8003BC90 00451021 */  addu      $v0, $v0, $a1
/* 17094 8003BC94 8C510000 */  lw        $s1, 0x0($v0)
/* 17098 8003BC98 00031FC3 */  sra       $v1, $v1, 31
/* 1709C 8003BC9C AE7402C8 */  sw        $s4, 0x2C8($s3)
/* 170A0 8003BCA0 00004010 */  mfhi      $t0
/* 170A4 8003BCA4 00081143 */  sra       $v0, $t0, 5
/* 170A8 8003BCA8 00431023 */  subu      $v0, $v0, $v1
/* 170AC 8003BCAC 00021400 */  sll       $v0, $v0, 16
/* 170B0 8003BCB0 0002AC03 */  sra       $s5, $v0, 16
.L8003BCB4:
/* 170B4 8003BCB4 96440000 */  lhu       $a0, 0x0($s2)
/* 170B8 8003BCB8 26520002 */  addiu     $s2, $s2, 0x2
/* 170BC 8003BCBC 96250000 */  lhu       $a1, 0x0($s1)
/* 170C0 8003BCC0 26310002 */  addiu     $s1, $s1, 0x2
/* 170C4 8003BCC4 02A0302D */  daddu     $a2, $s5, $zero
/* 170C8 8003BCC8 0C00EE5B */  jal       npc_blend_palette_colors
/* 170CC 8003BCCC 26100001 */   addiu    $s0, $s0, 0x1
/* 170D0 8003BCD0 A6820000 */  sh        $v0, 0x0($s4)
/* 170D4 8003BCD4 2A020010 */  slti      $v0, $s0, 0x10
/* 170D8 8003BCD8 1440FFF6 */  bnez      $v0, .L8003BCB4
/* 170DC 8003BCDC 26940002 */   addiu    $s4, $s4, 0x2
/* 170E0 8003BCE0 240200FF */  addiu     $v0, $zero, 0xFF
/* 170E4 8003BCE4 16A20004 */  bne       $s5, $v0, .L8003BCF8
/* 170E8 8003BCE8 24020002 */   addiu    $v0, $zero, 0x2
/* 170EC 8003BCEC 96630310 */  lhu       $v1, 0x310($s3)
/* 170F0 8003BCF0 A26200B7 */  sb        $v0, 0xB7($s3)
/* 170F4 8003BCF4 A66300BC */  sh        $v1, 0xBC($s3)
.L8003BCF8:
/* 170F8 8003BCF8 826300B7 */  lb        $v1, 0xB7($s3)
/* 170FC 8003BCFC 24020002 */  addiu     $v0, $zero, 0x2
.L8003BD00:
/* 17100 8003BD00 10620005 */  beq       $v1, $v0, .L8003BD18
/* 17104 8003BD04 24020003 */   addiu    $v0, $zero, 0x3
/* 17108 8003BD08 1062000A */  beq       $v1, $v0, .L8003BD34
/* 1710C 8003BD0C 00000000 */   nop
/* 17110 8003BD10 0800EF8B */  j         .L8003BE2C
/* 17114 8003BD14 00000000 */   nop
.L8003BD18:
/* 17118 8003BD18 866200BC */  lh        $v0, 0xBC($s3)
/* 1711C 8003BD1C 966300BC */  lhu       $v1, 0xBC($s3)
/* 17120 8003BD20 14400041 */  bnez      $v0, .L8003BE28
/* 17124 8003BD24 2462FFFF */   addiu    $v0, $v1, -0x1
/* 17128 8003BD28 24020003 */  addiu     $v0, $zero, 0x3
/* 1712C 8003BD2C A66000BE */  sh        $zero, 0xBE($s3)
/* 17130 8003BD30 A26200B7 */  sb        $v0, 0xB7($s3)
.L8003BD34:
/* 17134 8003BD34 86620312 */  lh        $v0, 0x312($s3)
/* 17138 8003BD38 24036400 */  addiu     $v1, $zero, 0x6400
/* 1713C 8003BD3C 14400002 */  bnez      $v0, .L8003BD48
/* 17140 8003BD40 0062001A */   div      $zero, $v1, $v0
/* 17144 8003BD44 0007000D */  break     7
.L8003BD48:
/* 17148 8003BD48 2401FFFF */  addiu     $at, $zero, -0x1
/* 1714C 8003BD4C 14410004 */  bne       $v0, $at, .L8003BD60
/* 17150 8003BD50 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 17154 8003BD54 14610002 */  bne       $v1, $at, .L8003BD60
/* 17158 8003BD58 00000000 */   nop
/* 1715C 8003BD5C 0006000D */  break     6
.L8003BD60:
/* 17160 8003BD60 00001812 */  mflo      $v1
/* 17164 8003BD64 966200BE */  lhu       $v0, 0xBE($s3)
/* 17168 8003BD68 00431021 */  addu      $v0, $v0, $v1
/* 1716C 8003BD6C A66200BE */  sh        $v0, 0xBE($s3)
/* 17170 8003BD70 00021400 */  sll       $v0, $v0, 16
/* 17174 8003BD74 00021403 */  sra       $v0, $v0, 16
/* 17178 8003BD78 2842639D */  slti      $v0, $v0, 0x639D
/* 1717C 8003BD7C 14400003 */  bnez      $v0, .L8003BD8C
/* 17180 8003BD80 3C0651EB */   lui      $a2, (0x51EB851F >> 16)
/* 17184 8003BD84 2402639C */  addiu     $v0, $zero, 0x639C
/* 17188 8003BD88 A66200BE */  sh        $v0, 0xBE($s3)
.L8003BD8C:
/* 1718C 8003BD8C 34C6851F */  ori       $a2, $a2, (0x51EB851F & 0xFFFF)
/* 17190 8003BD90 267400C8 */  addiu     $s4, $s3, 0xC8
/* 17194 8003BD94 0000802D */  daddu     $s0, $zero, $zero
/* 17198 8003BD98 8662030A */  lh        $v0, 0x30A($s3)
/* 1719C 8003BD9C 8E6500C4 */  lw        $a1, 0xC4($s3)
/* 171A0 8003BDA0 966300BE */  lhu       $v1, 0xBE($s3)
/* 171A4 8003BDA4 00021080 */  sll       $v0, $v0, 2
/* 171A8 8003BDA8 00451021 */  addu      $v0, $v0, $a1
/* 171AC 8003BDAC 00031C00 */  sll       $v1, $v1, 16
/* 171B0 8003BDB0 00032403 */  sra       $a0, $v1, 16
/* 171B4 8003BDB4 8C520000 */  lw        $s2, 0x0($v0)
/* 171B8 8003BDB8 86620308 */  lh        $v0, 0x308($s3)
/* 171BC 8003BDBC 00860018 */  mult      $a0, $a2
/* 171C0 8003BDC0 00021080 */  sll       $v0, $v0, 2
/* 171C4 8003BDC4 00451021 */  addu      $v0, $v0, $a1
/* 171C8 8003BDC8 8C510000 */  lw        $s1, 0x0($v0)
/* 171CC 8003BDCC 00031FC3 */  sra       $v1, $v1, 31
/* 171D0 8003BDD0 AE7402C8 */  sw        $s4, 0x2C8($s3)
/* 171D4 8003BDD4 00004010 */  mfhi      $t0
/* 171D8 8003BDD8 00081143 */  sra       $v0, $t0, 5
/* 171DC 8003BDDC 00431023 */  subu      $v0, $v0, $v1
/* 171E0 8003BDE0 00021400 */  sll       $v0, $v0, 16
/* 171E4 8003BDE4 0002AC03 */  sra       $s5, $v0, 16
.L8003BDE8:
/* 171E8 8003BDE8 96440000 */  lhu       $a0, 0x0($s2)
/* 171EC 8003BDEC 26520002 */  addiu     $s2, $s2, 0x2
/* 171F0 8003BDF0 96250000 */  lhu       $a1, 0x0($s1)
/* 171F4 8003BDF4 26310002 */  addiu     $s1, $s1, 0x2
/* 171F8 8003BDF8 02A0302D */  daddu     $a2, $s5, $zero
/* 171FC 8003BDFC 0C00EE5B */  jal       npc_blend_palette_colors
/* 17200 8003BE00 26100001 */   addiu    $s0, $s0, 0x1
/* 17204 8003BE04 A6820000 */  sh        $v0, 0x0($s4)
/* 17208 8003BE08 2A020010 */  slti      $v0, $s0, 0x10
/* 1720C 8003BE0C 1440FFF6 */  bnez      $v0, .L8003BDE8
/* 17210 8003BE10 26940002 */   addiu    $s4, $s4, 0x2
/* 17214 8003BE14 240200FF */  addiu     $v0, $zero, 0xFF
/* 17218 8003BE18 16A20004 */  bne       $s5, $v0, .L8003BE2C
/* 1721C 8003BE1C 00000000 */   nop
/* 17220 8003BE20 9662030C */  lhu       $v0, 0x30C($s3)
/* 17224 8003BE24 A26000B7 */  sb        $zero, 0xB7($s3)
.L8003BE28:
/* 17228 8003BE28 A66200BC */  sh        $v0, 0xBC($s3)
.L8003BE2C:
/* 1722C 8003BE2C 826300B7 */  lb        $v1, 0xB7($s3)
/* 17230 8003BE30 28620004 */  slti      $v0, $v1, 0x4
/* 17234 8003BE34 1040001D */  beqz      $v0, .L8003BEAC
/* 17238 8003BE38 00000000 */   nop
/* 1723C 8003BE3C 0460001B */  bltz      $v1, .L8003BEAC
/* 17240 8003BE40 3C034000 */   lui      $v1, (0x40000000 >> 16)
/* 17244 8003BE44 8E620000 */  lw        $v0, 0x0($s3)
/* 17248 8003BE48 00431024 */  and       $v0, $v0, $v1
/* 1724C 8003BE4C 14400017 */  bnez      $v0, .L8003BEAC
/* 17250 8003BE50 02C0282D */   daddu    $a1, $s6, $zero
/* 17254 8003BE54 926300AC */  lbu       $v1, 0xAC($s3)
/* 17258 8003BE58 926200AD */  lbu       $v0, 0xAD($s3)
/* 1725C 8003BE5C 00620018 */  mult      $v1, $v0
/* 17260 8003BE60 00001812 */  mflo      $v1
/* 17264 8003BE64 3C028080 */  lui       $v0, (0x80808081 >> 16)
/* 17268 8003BE68 34428081 */  ori       $v0, $v0, (0x80808081 & 0xFFFF)
/* 1726C 8003BE6C 00620018 */  mult      $v1, $v0
/* 17270 8003BE70 8E660024 */  lw        $a2, 0x24($s3)
/* 17274 8003BE74 266702C8 */  addiu     $a3, $s3, 0x2C8
/* 17278 8003BE78 AFB70010 */  sw        $s7, 0x10($sp)
/* 1727C 8003BE7C 00004810 */  mfhi      $t1
/* 17280 8003BE80 01231021 */  addu      $v0, $t1, $v1
/* 17284 8003BE84 000211C3 */  sra       $v0, $v0, 7
/* 17288 8003BE88 00031FC3 */  sra       $v1, $v1, 31
/* 1728C 8003BE8C 0043A823 */  subu      $s5, $v0, $v1
/* 17290 8003BE90 2AA400FF */  slti      $a0, $s5, 0xFF
/* 17294 8003BE94 000427C0 */  sll       $a0, $a0, 31
/* 17298 8003BE98 3C022000 */  lui       $v0, (0x20000000 >> 16)
/* 1729C 8003BE9C 00822025 */  or        $a0, $a0, $v0
/* 172A0 8003BEA0 00C42025 */  or        $a0, $a2, $a0
/* 172A4 8003BEA4 0C0B78F6 */  jal       spr_draw_npc_sprite
/* 172A8 8003BEA8 02A0302D */   daddu    $a2, $s5, $zero
.L8003BEAC:
/* 172AC 8003BEAC 8FBF0038 */  lw        $ra, 0x38($sp)
/* 172B0 8003BEB0 8FB70034 */  lw        $s7, 0x34($sp)
/* 172B4 8003BEB4 8FB60030 */  lw        $s6, 0x30($sp)
/* 172B8 8003BEB8 8FB5002C */  lw        $s5, 0x2C($sp)
/* 172BC 8003BEBC 8FB40028 */  lw        $s4, 0x28($sp)
/* 172C0 8003BEC0 8FB30024 */  lw        $s3, 0x24($sp)
/* 172C4 8003BEC4 8FB20020 */  lw        $s2, 0x20($sp)
/* 172C8 8003BEC8 8FB1001C */  lw        $s1, 0x1C($sp)
/* 172CC 8003BECC 8FB00018 */  lw        $s0, 0x18($sp)
/* 172D0 8003BED0 03E00008 */  jr        $ra
/* 172D4 8003BED4 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

s32 npc_draw_palswap_mode_2(Npc* npc, s32 arg1, s32 arg2, Matrix4f mtx) {
    s32 i, j;
    PAL_PTR src;
    PAL_PTR dst;
    PAL_PTR src2;
    s32 blendAlpha;

    if (npc->dirtyPalettes != 0) {
        if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
            npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16);
        }

        npc->paletteCount = 0;
        while ((s32)npc->spritePaletteList[npc->paletteCount] != -1) {
            npc->paletteCount++;
        }

        if (npc->dirtyPalettes == 1) {
            npc->palSwapState = 0;
            npc->palSwapLerpAlpha = 0;
        } else {
            npc->palSwapState = 0;
            npc->palSwapLerpAlpha = 255;
        }

        for (i = 0; i < npc->paletteCount; i++) {
            src2 = npc->localPaletteData[i];
            src = npc->spritePaletteList[i];
            npc->localPalettes[i] = src2;
            if (src != NULL) {
                for (j = 0; j < 16; j++) {
                    *src2++ = *src++;
                }
            }
        }

        if (arg2 == 0) {
            s32 temp2 = npc->unk_30C;
            npc->unk_30C = 0;
            npc->unk_30E = temp2;
            npc->unk_310 = temp2;
            npc->unk_312 = npc->unk_30E;
        }

        npc->palSwapLerpAlpha = 0;
        npc->palSwapState = 0;
        npc->dirtyPalettes = 0;
        npc->palSwapTimer = npc->unk_30C;
    }

    switch (npc->palSwapState) {
        case 0:
            if (npc->palSwapTimer != 0) {
                npc->palSwapTimer--;
                break;
            } else {
                npc->palSwapLerpAlpha = 0;
                npc->palSwapState = 1;
            }
            // fallthrough
        case 1:
            npc->palSwapLerpAlpha += 25600 / npc->unk_30E;
            if (npc->palSwapLerpAlpha > 25500) {
                npc->palSwapLerpAlpha = 25500;
            }
            blendAlpha = npc->palSwapLerpAlpha / 100;
            dst = npc->localPaletteData[0];
            src = npc->spritePaletteList[npc->unk_308];
            src2 = npc->spritePaletteList[npc->unk_30A];
            npc->localPalettes[0] = dst;

            for (j = 0; j < 16; j++) {
                *dst++ = npc_blend_palette_colors(*src++, *src2++, blendAlpha);
            }

            if (blendAlpha == 255) {
                npc->palSwapState = 2;
                npc->palSwapTimer = npc->unk_310;
            }
            break;
    }
    switch (npc->palSwapState) {
        case 2:
            if (npc->palSwapTimer != 0) {
                npc->palSwapTimer--;
                break;
            } else {
                npc->palSwapLerpAlpha = 0;
                npc->palSwapState = 3;
            }
            // fallthrough
        case 3:
            npc->palSwapLerpAlpha += 25600 / npc->unk_312;
            if (npc->palSwapLerpAlpha > 25500) {
                npc->palSwapLerpAlpha = 25500;
            }
            blendAlpha = npc->palSwapLerpAlpha / 100;
            dst = npc->localPaletteData[0];
            src = npc->spritePaletteList[npc->unk_30A];
            src2 = npc->spritePaletteList[npc->unk_308];
            npc->localPalettes[0] = dst;

            for (j = 0; j < 16; j++) {
                *dst++ = npc_blend_palette_colors(*src++, *src2++, blendAlpha);
            }

            if (blendAlpha == 255) {
                npc->palSwapState = 0;
                npc->palSwapTimer = npc->unk_30C;
            }
            break;
    }

    if (npc->palSwapState < 4) {
        if (npc->palSwapState >= 0) {
            if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
                u32 mask;
                blendAlpha = npc->alpha * npc->alpha2 / 255;
                if (blendAlpha < 255) {
                    mask = DRAW_SPRITE_OVERRIDE_ALPHA;
                } else {
                    mask = 0;
                }
                mask |= DRAW_SPRITE_OVERRIDE_PALETTES;
                spr_draw_npc_sprite(npc->spriteInstanceID | mask, arg1, blendAlpha, npc->localPalettes, mtx);
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_base_switch_animate_scale
/* 10375C 802E1EDC 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 103760 802E1EE0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 103764 802E1EE4 0080882D */  daddu     $s1, $a0, $zero
/* 103768 802E1EE8 AFBF0024 */  sw        $ra, 0x24($sp)
/* 10376C 802E1EEC AFB20020 */  sw        $s2, 0x20($sp)
/* 103770 802E1EF0 AFB00018 */  sw        $s0, 0x18($sp)
/* 103774 802E1EF4 8E300040 */  lw        $s0, 0x40($s1)
/* 103778 802E1EF8 82030010 */  lb        $v1, 0x10($s0)
/* 10377C 802E1EFC 2C620005 */  sltiu     $v0, $v1, 0x5
/* 103780 802E1F00 10400087 */  beqz      $v0, .L802E2120
/* 103784 802E1F04 0000902D */   daddu    $s2, $zero, $zero
/* 103788 802E1F08 00031080 */  sll       $v0, $v1, 2
/* 10378C 802E1F0C 3C01802F */  lui       $at, %hi(jtbl_802EB0C0)
/* 103790 802E1F10 00220821 */  addu      $at, $at, $v0
/* 103794 802E1F14 8C22B0C0 */  lw        $v0, %lo(jtbl_802EB0C0)($at)
/* 103798 802E1F18 00400008 */  jr        $v0
/* 10379C 802E1F1C 00000000 */   nop
glabel .L802E1F20
/* 1037A0 802E1F20 C602001C */  lwc1      $f2, 0x1C($s0)
/* 1037A4 802E1F24 3C01802F */  lui       $at, %hi(D_802EB0D8)
/* 1037A8 802E1F28 D420B0D8 */  ldc1      $f0, %lo(D_802EB0D8)($at)
/* 1037AC 802E1F2C 460010A1 */  cvt.d.s   $f2, $f2
/* 1037B0 802E1F30 46201082 */  mul.d     $f2, $f2, $f0
/* 1037B4 802E1F34 00000000 */  nop
/* 1037B8 802E1F38 C6000014 */  lwc1      $f0, 0x14($s0)
/* 1037BC 802E1F3C 462011A0 */  cvt.s.d   $f6, $f2
/* 1037C0 802E1F40 46060000 */  add.s     $f0, $f0, $f6
/* 1037C4 802E1F44 C6220054 */  lwc1      $f2, 0x54($s1)
/* 1037C8 802E1F48 46020001 */  sub.s     $f0, $f0, $f2
/* 1037CC 802E1F4C 3C013FD0 */  lui       $at, (0x3FD00000 >> 16)
/* 1037D0 802E1F50 44811800 */  mtc1      $at, $f3
/* 1037D4 802E1F54 44801000 */  mtc1      $zero, $f2
/* 1037D8 802E1F58 46000021 */  cvt.d.s   $f0, $f0
/* 1037DC 802E1F5C 46220002 */  mul.d     $f0, $f0, $f2
/* 1037E0 802E1F60 00000000 */  nop
/* 1037E4 802E1F64 3C01802F */  lui       $at, %hi(D_802EB0E0)
/* 1037E8 802E1F68 D422B0E0 */  ldc1      $f2, %lo(D_802EB0E0)($at)
/* 1037EC 802E1F6C 46200120 */  cvt.s.d   $f4, $f0
/* 1037F0 802E1F70 46002021 */  cvt.d.s   $f0, $f4
/* 1037F4 802E1F74 4622003C */  c.lt.d    $f0, $f2
/* 1037F8 802E1F78 00000000 */  nop
/* 1037FC 802E1F7C 45000004 */  bc1f      .L802E1F90
/* 103800 802E1F80 00000000 */   nop
/* 103804 802E1F84 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* 103808 802E1F88 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* 10380C 802E1F8C 44812000 */  mtc1      $at, $f4
.L802E1F90:
/* 103810 802E1F90 C6000004 */  lwc1      $f0, 0x4($s0)
/* 103814 802E1F94 46040000 */  add.s     $f0, $f0, $f4
/* 103818 802E1F98 E6000004 */  swc1      $f0, 0x4($s0)
/* 10381C 802E1F9C C6220054 */  lwc1      $f2, 0x54($s1)
/* 103820 802E1FA0 46001080 */  add.s     $f2, $f2, $f0
/* 103824 802E1FA4 E6220054 */  swc1      $f2, 0x54($s1)
/* 103828 802E1FA8 C6000014 */  lwc1      $f0, 0x14($s0)
/* 10382C 802E1FAC 46060000 */  add.s     $f0, $f0, $f6
/* 103830 802E1FB0 4602003E */  c.le.s    $f0, $f2
/* 103834 802E1FB4 080B8840 */  j         .L802E2100
/* 103838 802E1FB8 00000000 */   nop
glabel .L802E1FBC
/* 10383C 802E1FBC C602001C */  lwc1      $f2, 0x1C($s0)
/* 103840 802E1FC0 3C01802F */  lui       $at, %hi(D_802EB0E8)
/* 103844 802E1FC4 D420B0E8 */  ldc1      $f0, %lo(D_802EB0E8)($at)
/* 103848 802E1FC8 080B881F */  j         .L802E207C
/* 10384C 802E1FCC 460010A1 */   cvt.d.s  $f2, $f2
glabel .L802E1FD0
/* 103850 802E1FD0 C602001C */  lwc1      $f2, 0x1C($s0)
/* 103854 802E1FD4 3C01802F */  lui       $at, %hi(D_802EB0F0)
/* 103858 802E1FD8 D420B0F0 */  ldc1      $f0, %lo(D_802EB0F0)($at)
/* 10385C 802E1FDC 460010A1 */  cvt.d.s   $f2, $f2
/* 103860 802E1FE0 46201082 */  mul.d     $f2, $f2, $f0
/* 103864 802E1FE4 00000000 */  nop
/* 103868 802E1FE8 C6000014 */  lwc1      $f0, 0x14($s0)
/* 10386C 802E1FEC 462011A0 */  cvt.s.d   $f6, $f2
/* 103870 802E1FF0 46060000 */  add.s     $f0, $f0, $f6
/* 103874 802E1FF4 C6220054 */  lwc1      $f2, 0x54($s1)
/* 103878 802E1FF8 46020001 */  sub.s     $f0, $f0, $f2
/* 10387C 802E1FFC 3C013FD0 */  lui       $at, (0x3FD00000 >> 16)
/* 103880 802E2000 44811800 */  mtc1      $at, $f3
/* 103884 802E2004 44801000 */  mtc1      $zero, $f2
/* 103888 802E2008 46000021 */  cvt.d.s   $f0, $f0
/* 10388C 802E200C 46220002 */  mul.d     $f0, $f0, $f2
/* 103890 802E2010 00000000 */  nop
/* 103894 802E2014 3C01802F */  lui       $at, %hi(D_802EB0F8)
/* 103898 802E2018 D422B0F8 */  ldc1      $f2, %lo(D_802EB0F8)($at)
/* 10389C 802E201C 46200120 */  cvt.s.d   $f4, $f0
/* 1038A0 802E2020 46002021 */  cvt.d.s   $f0, $f4
/* 1038A4 802E2024 4622003C */  c.lt.d    $f0, $f2
/* 1038A8 802E2028 00000000 */  nop
/* 1038AC 802E202C 45000004 */  bc1f      .L802E2040
/* 1038B0 802E2030 00000000 */   nop
/* 1038B4 802E2034 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* 1038B8 802E2038 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* 1038BC 802E203C 44812000 */  mtc1      $at, $f4
.L802E2040:
/* 1038C0 802E2040 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1038C4 802E2044 46040000 */  add.s     $f0, $f0, $f4
/* 1038C8 802E2048 E6000004 */  swc1      $f0, 0x4($s0)
/* 1038CC 802E204C C6220054 */  lwc1      $f2, 0x54($s1)
/* 1038D0 802E2050 46001080 */  add.s     $f2, $f2, $f0
/* 1038D4 802E2054 E6220054 */  swc1      $f2, 0x54($s1)
/* 1038D8 802E2058 C6000014 */  lwc1      $f0, 0x14($s0)
/* 1038DC 802E205C 46060000 */  add.s     $f0, $f0, $f6
/* 1038E0 802E2060 4602003E */  c.le.s    $f0, $f2
/* 1038E4 802E2064 080B8840 */  j         .L802E2100
/* 1038E8 802E2068 00000000 */   nop
glabel .L802E206C
/* 1038EC 802E206C C602001C */  lwc1      $f2, 0x1C($s0)
/* 1038F0 802E2070 3C01802F */  lui       $at, %hi(D_802EB100)
/* 1038F4 802E2074 D420B100 */  ldc1      $f0, %lo(D_802EB100)($at)
/* 1038F8 802E2078 460010A1 */  cvt.d.s   $f2, $f2
.L802E207C:
/* 1038FC 802E207C 46201082 */  mul.d     $f2, $f2, $f0
/* 103900 802E2080 00000000 */  nop
/* 103904 802E2084 C6000014 */  lwc1      $f0, 0x14($s0)
/* 103908 802E2088 462011A0 */  cvt.s.d   $f6, $f2
/* 10390C 802E208C 46060000 */  add.s     $f0, $f0, $f6
/* 103910 802E2090 C6220054 */  lwc1      $f2, 0x54($s1)
/* 103914 802E2094 46020001 */  sub.s     $f0, $f0, $f2
/* 103918 802E2098 3C014018 */  lui       $at, (0x40180000 >> 16)
/* 10391C 802E209C 44811800 */  mtc1      $at, $f3
/* 103920 802E20A0 44801000 */  mtc1      $zero, $f2
/* 103924 802E20A4 46000021 */  cvt.d.s   $f0, $f0
/* 103928 802E20A8 46220003 */  div.d     $f0, $f0, $f2
/* 10392C 802E20AC 46200120 */  cvt.s.d   $f4, $f0
/* 103930 802E20B0 3C01802F */  lui       $at, %hi(D_802EB108)
/* 103934 802E20B4 D422B108 */  ldc1      $f2, %lo(D_802EB108)($at)
/* 103938 802E20B8 46002021 */  cvt.d.s   $f0, $f4
/* 10393C 802E20BC 4620103C */  c.lt.d    $f2, $f0
/* 103940 802E20C0 00000000 */  nop
/* 103944 802E20C4 45000004 */  bc1f      .L802E20D8
/* 103948 802E20C8 00000000 */   nop
/* 10394C 802E20CC 3C01BC23 */  lui       $at, (0xBC23D70A >> 16)
/* 103950 802E20D0 3421D70A */  ori       $at, $at, (0xBC23D70A & 0xFFFF)
/* 103954 802E20D4 44812000 */  mtc1      $at, $f4
.L802E20D8:
/* 103958 802E20D8 C6000004 */  lwc1      $f0, 0x4($s0)
/* 10395C 802E20DC 46040000 */  add.s     $f0, $f0, $f4
/* 103960 802E20E0 E6000004 */  swc1      $f0, 0x4($s0)
/* 103964 802E20E4 C6220054 */  lwc1      $f2, 0x54($s1)
/* 103968 802E20E8 46001080 */  add.s     $f2, $f2, $f0
/* 10396C 802E20EC E6220054 */  swc1      $f2, 0x54($s1)
/* 103970 802E20F0 C6000014 */  lwc1      $f0, 0x14($s0)
/* 103974 802E20F4 46060000 */  add.s     $f0, $f0, $f6
/* 103978 802E20F8 4600103E */  c.le.s    $f2, $f0
/* 10397C 802E20FC 00000000 */  nop
.L802E2100:
/* 103980 802E2100 45000007 */  bc1f      .L802E2120
/* 103984 802E2104 00000000 */   nop
/* 103988 802E2108 92020010 */  lbu       $v0, 0x10($s0)
/* 10398C 802E210C AE000004 */  sw        $zero, 0x4($s0)
/* 103990 802E2110 24420001 */  addiu     $v0, $v0, 0x1
/* 103994 802E2114 080B8848 */  j         .L802E2120
/* 103998 802E2118 A2020010 */   sb       $v0, 0x10($s0)
glabel .L802E211C
/* 10399C 802E211C 26520001 */  addiu     $s2, $s2, 0x1
.L802E2120:
/* 1039A0 802E2120 C6200054 */  lwc1      $f0, 0x54($s1)
/* 1039A4 802E2124 E620005C */  swc1      $f0, 0x5C($s1)
/* 1039A8 802E2128 82030011 */  lb        $v1, 0x11($s0)
/* 1039AC 802E212C 24020001 */  addiu     $v0, $zero, 0x1
/* 1039B0 802E2130 10620013 */  beq       $v1, $v0, .L802E2180
/* 1039B4 802E2134 28620002 */   slti     $v0, $v1, 0x2
/* 1039B8 802E2138 10400005 */  beqz      $v0, .L802E2150
/* 1039BC 802E213C 24020002 */   addiu    $v0, $zero, 0x2
/* 1039C0 802E2140 10600009 */  beqz      $v1, .L802E2168
/* 1039C4 802E2144 00000000 */   nop
/* 1039C8 802E2148 080B88B1 */  j         .L802E22C4
/* 1039CC 802E214C 00000000 */   nop
.L802E2150:
/* 1039D0 802E2150 10620031 */  beq       $v1, $v0, .L802E2218
/* 1039D4 802E2154 24020003 */   addiu    $v0, $zero, 0x3
/* 1039D8 802E2158 5062005A */  beql      $v1, $v0, .L802E22C4
/* 1039DC 802E215C 26520001 */   addiu    $s2, $s2, 0x1
/* 1039E0 802E2160 080B88B1 */  j         .L802E22C4
/* 1039E4 802E2164 00000000 */   nop
.L802E2168:
/* 1039E8 802E2168 C602001C */  lwc1      $f2, 0x1C($s0)
/* 1039EC 802E216C 3C01BFE0 */  lui       $at, (0xBFE00000 >> 16)
/* 1039F0 802E2170 44810800 */  mtc1      $at, $f1
/* 1039F4 802E2174 44800000 */  mtc1      $zero, $f0
/* 1039F8 802E2178 080B888A */  j         .L802E2228
/* 1039FC 802E217C 460010A1 */   cvt.d.s  $f2, $f2
.L802E2180:
/* 103A00 802E2180 C602001C */  lwc1      $f2, 0x1C($s0)
/* 103A04 802E2184 3C01802F */  lui       $at, %hi(D_802EB110)
/* 103A08 802E2188 D420B110 */  ldc1      $f0, %lo(D_802EB110)($at)
/* 103A0C 802E218C 460010A1 */  cvt.d.s   $f2, $f2
/* 103A10 802E2190 46201082 */  mul.d     $f2, $f2, $f0
/* 103A14 802E2194 00000000 */  nop
/* 103A18 802E2198 C6000018 */  lwc1      $f0, 0x18($s0)
/* 103A1C 802E219C 462011A0 */  cvt.s.d   $f6, $f2
/* 103A20 802E21A0 46060000 */  add.s     $f0, $f0, $f6
/* 103A24 802E21A4 C6220058 */  lwc1      $f2, 0x58($s1)
/* 103A28 802E21A8 46020001 */  sub.s     $f0, $f0, $f2
/* 103A2C 802E21AC 3C014024 */  lui       $at, (0x40240000 >> 16)
/* 103A30 802E21B0 44811800 */  mtc1      $at, $f3
/* 103A34 802E21B4 44801000 */  mtc1      $zero, $f2
/* 103A38 802E21B8 46000021 */  cvt.d.s   $f0, $f0
/* 103A3C 802E21BC 46220003 */  div.d     $f0, $f0, $f2
/* 103A40 802E21C0 46200120 */  cvt.s.d   $f4, $f0
/* 103A44 802E21C4 3C01802F */  lui       $at, %hi(D_802EB118)
/* 103A48 802E21C8 D422B118 */  ldc1      $f2, %lo(D_802EB118)($at)
/* 103A4C 802E21CC 46002021 */  cvt.d.s   $f0, $f4
/* 103A50 802E21D0 4622003C */  c.lt.d    $f0, $f2
/* 103A54 802E21D4 00000000 */  nop
/* 103A58 802E21D8 45000004 */  bc1f      .L802E21EC
/* 103A5C 802E21DC 00000000 */   nop
/* 103A60 802E21E0 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* 103A64 802E21E4 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* 103A68 802E21E8 44812000 */  mtc1      $at, $f4
.L802E21EC:
/* 103A6C 802E21EC C6000008 */  lwc1      $f0, 0x8($s0)
/* 103A70 802E21F0 46040000 */  add.s     $f0, $f0, $f4
/* 103A74 802E21F4 E6000008 */  swc1      $f0, 0x8($s0)
/* 103A78 802E21F8 C6220058 */  lwc1      $f2, 0x58($s1)
/* 103A7C 802E21FC 46001080 */  add.s     $f2, $f2, $f0
/* 103A80 802E2200 E6220058 */  swc1      $f2, 0x58($s1)
/* 103A84 802E2204 C6000018 */  lwc1      $f0, 0x18($s0)
/* 103A88 802E2208 46060000 */  add.s     $f0, $f0, $f6
/* 103A8C 802E220C 4602003E */  c.le.s    $f0, $f2
/* 103A90 802E2210 080B88AB */  j         .L802E22AC
/* 103A94 802E2214 00000000 */   nop
.L802E2218:
/* 103A98 802E2218 C602001C */  lwc1      $f2, 0x1C($s0)
/* 103A9C 802E221C 3C01802F */  lui       $at, %hi(D_802EB120)
/* 103AA0 802E2220 D420B120 */  ldc1      $f0, %lo(D_802EB120)($at)
/* 103AA4 802E2224 460010A1 */  cvt.d.s   $f2, $f2
.L802E2228:
/* 103AA8 802E2228 46201082 */  mul.d     $f2, $f2, $f0
/* 103AAC 802E222C 00000000 */  nop
/* 103AB0 802E2230 C6000018 */  lwc1      $f0, 0x18($s0)
/* 103AB4 802E2234 462011A0 */  cvt.s.d   $f6, $f2
/* 103AB8 802E2238 46060000 */  add.s     $f0, $f0, $f6
/* 103ABC 802E223C C6220058 */  lwc1      $f2, 0x58($s1)
/* 103AC0 802E2240 46020001 */  sub.s     $f0, $f0, $f2
/* 103AC4 802E2244 3C014014 */  lui       $at, (0x40140000 >> 16)
/* 103AC8 802E2248 44811800 */  mtc1      $at, $f3
/* 103ACC 802E224C 44801000 */  mtc1      $zero, $f2
/* 103AD0 802E2250 46000021 */  cvt.d.s   $f0, $f0
/* 103AD4 802E2254 46220003 */  div.d     $f0, $f0, $f2
/* 103AD8 802E2258 46200120 */  cvt.s.d   $f4, $f0
/* 103ADC 802E225C 3C01802F */  lui       $at, %hi(D_802EB128)
/* 103AE0 802E2260 D422B128 */  ldc1      $f2, %lo(D_802EB128)($at)
/* 103AE4 802E2264 46002021 */  cvt.d.s   $f0, $f4
/* 103AE8 802E2268 4620103C */  c.lt.d    $f2, $f0
/* 103AEC 802E226C 00000000 */  nop
/* 103AF0 802E2270 45000004 */  bc1f      .L802E2284
/* 103AF4 802E2274 00000000 */   nop
/* 103AF8 802E2278 3C01BC23 */  lui       $at, (0xBC23D70A >> 16)
/* 103AFC 802E227C 3421D70A */  ori       $at, $at, (0xBC23D70A & 0xFFFF)
/* 103B00 802E2280 44812000 */  mtc1      $at, $f4
.L802E2284:
/* 103B04 802E2284 C6000008 */  lwc1      $f0, 0x8($s0)
/* 103B08 802E2288 46040000 */  add.s     $f0, $f0, $f4
/* 103B0C 802E228C E6000008 */  swc1      $f0, 0x8($s0)
/* 103B10 802E2290 C6220058 */  lwc1      $f2, 0x58($s1)
/* 103B14 802E2294 46001080 */  add.s     $f2, $f2, $f0
/* 103B18 802E2298 E6220058 */  swc1      $f2, 0x58($s1)
/* 103B1C 802E229C C6000018 */  lwc1      $f0, 0x18($s0)
/* 103B20 802E22A0 46060000 */  add.s     $f0, $f0, $f6
/* 103B24 802E22A4 4600103E */  c.le.s    $f2, $f0
/* 103B28 802E22A8 00000000 */  nop
.L802E22AC:
/* 103B2C 802E22AC 45000005 */  bc1f      .L802E22C4
/* 103B30 802E22B0 00000000 */   nop
/* 103B34 802E22B4 92020011 */  lbu       $v0, 0x11($s0)
/* 103B38 802E22B8 AE000008 */  sw        $zero, 0x8($s0)
/* 103B3C 802E22BC 24420001 */  addiu     $v0, $v0, 0x1
/* 103B40 802E22C0 A2020011 */  sb        $v0, 0x11($s0)
.L802E22C4:
/* 103B44 802E22C4 0C0B854F */  jal       entity_switch_fall_down
/* 103B48 802E22C8 0220202D */   daddu    $a0, $s1, $zero
/* 103B4C 802E22CC 24020002 */  addiu     $v0, $zero, 0x2
/* 103B50 802E22D0 16420004 */  bne       $s2, $v0, .L802E22E4
/* 103B54 802E22D4 0220202D */   daddu    $a0, $s1, $zero
/* 103B58 802E22D8 A2000010 */  sb        $zero, 0x10($s0)
/* 103B5C 802E22DC 0C043F5A */  jal       exec_entity_commandlist
/* 103B60 802E22E0 A2000011 */   sb       $zero, 0x11($s0)
.L802E22E4:
/* 103B64 802E22E4 96020024 */  lhu       $v0, 0x24($s0)
/* 103B68 802E22E8 2403000A */  addiu     $v1, $zero, 0xA
/* 103B6C 802E22EC 24420001 */  addiu     $v0, $v0, 0x1
/* 103B70 802E22F0 A6020024 */  sh        $v0, 0x24($s0)
/* 103B74 802E22F4 00021400 */  sll       $v0, $v0, 16
/* 103B78 802E22F8 00021403 */  sra       $v0, $v0, 16
/* 103B7C 802E22FC 1443000D */  bne       $v0, $v1, .L802E2334
/* 103B80 802E2300 00000000 */   nop
/* 103B84 802E2304 8E020028 */  lw        $v0, 0x28($s0)
/* 103B88 802E2308 1440000A */  bnez      $v0, .L802E2334
/* 103B8C 802E230C 2402003C */   addiu    $v0, $zero, 0x3C
/* 103B90 802E2310 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 103B94 802E2314 44810000 */  mtc1      $at, $f0
/* 103B98 802E2318 AFA20014 */  sw        $v0, 0x14($sp)
/* 103B9C 802E231C E7A00010 */  swc1      $f0, 0x10($sp)
/* 103BA0 802E2320 8E250048 */  lw        $a1, 0x48($s1)
/* 103BA4 802E2324 8E26004C */  lw        $a2, 0x4C($s1)
/* 103BA8 802E2328 8E270050 */  lw        $a3, 0x50($s1)
/* 103BAC 802E232C 0C01C88C */  jal       fx_cold_breath
/* 103BB0 802E2330 0000202D */   daddu    $a0, $zero, $zero
.L802E2334:
/* 103BB4 802E2334 8FBF0024 */  lw        $ra, 0x24($sp)
/* 103BB8 802E2338 8FB20020 */  lw        $s2, 0x20($sp)
/* 103BBC 802E233C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 103BC0 802E2340 8FB00018 */  lw        $s0, 0x18($sp)
/* 103BC4 802E2344 03E00008 */  jr        $ra
/* 103BC8 802E2348 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void entity_base_switch_animate_scale(Entity* entity) {
    f32 phi_f4;
    f32 scaleChange;
    SwitchData* data = entity->dataBuf.swtch;
    s32 phi_s2 = 0;

    switch (data->animStateScaleX) {
        case 0:
            scaleChange = data->baseScale.z * 0.3;
            phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 4.0;
            if (phi_f4 < 0.01) {
                phi_f4 = 0.01f;
            }
            data->deltaScaleX += phi_f4;
            entity->scale.x += data->deltaScaleX;
            if ((data->baseScale.x + scaleChange) <= entity->scale.x) {
                data->deltaScaleX = 0.0f;
                data->animStateScaleX++;
            }
            break;
        case 1:
            scaleChange = (data->baseScale.z * -0.2);
            phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 6.0;
            if (phi_f4 > -0.01) {
                phi_f4 = -0.01f;
            }
            data->deltaScaleX += phi_f4;
            entity->scale.x += data->deltaScaleX;
            if (entity->scale.x <= (data->baseScale.x + scaleChange)) {
                data->deltaScaleX = 0.0f;
                data->animStateScaleX++;
            }
            break;
        case 2:
            scaleChange = data->baseScale.z * 0.15;
            phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 4.0;
            if (phi_f4 < 0.01) {
                phi_f4 = 0.01f;
            }
            data->deltaScaleX += phi_f4;
            entity->scale.x += data->deltaScaleX;
            if ((data->baseScale.x + scaleChange) <= entity->scale.x) {
                data->deltaScaleX = 0.0f;
                data->animStateScaleX++;
            }
            break;
        case 3:
            scaleChange = data->baseScale.z * -0.1;
            phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 6.0;
            if (phi_f4 > -0.01) {
                phi_f4 = -0.01f;
            }
            data->deltaScaleX += phi_f4;
            entity->scale.x += data->deltaScaleX;
            if (entity->scale.x <= (data->baseScale.x + scaleChange)) {
                data->deltaScaleX = 0.0f;
                data->animStateScaleX++;
            }
            break;
        case 4:
            phi_s2++;
            break;
    }

    entity->scale.z = entity->scale.x;

    switch (data->animStateScaleY) {
        case 0:
            scaleChange = data->baseScale.z * -0.5;
            phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 5.0;
            if (phi_f4 > -0.01) {
                phi_f4 = -0.01f;
            }
            data->deltaScaleY += phi_f4;
            entity->scale.y += data->deltaScaleY;
            if (entity->scale.y <= (data->baseScale.y + scaleChange)) {
                data->deltaScaleY = 0.0f;
                data->animStateScaleY++;
            }
            break;
        case 1:
            scaleChange = data->baseScale.z * 0.1;
            phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 10.0;
            if (phi_f4 < 0.01) {
                phi_f4 = 0.01f;
            }
            data->deltaScaleY += phi_f4;
            entity->scale.y += data->deltaScaleY;
            if ((data->baseScale.y + scaleChange) <= entity->scale.y) {
                data->deltaScaleY = 0.0f;
                data->animStateScaleY++;
            }
            break;
        case 2:
            scaleChange = data->baseScale.z * -0.3;
            phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 5.0;
            if (phi_f4 > -0.01) {
                phi_f4 = -0.01f;
            }
            data->deltaScaleY += phi_f4;
            entity->scale.y += data->deltaScaleY;
            if (entity->scale.y <= (data->baseScale.y + scaleChange)) {
                data->deltaScaleY = 0.0f;
                data->animStateScaleY++;
            }
            break;
        case 3:
            phi_s2++;
            break;
    }

    entity_switch_fall_down(entity);
    if (phi_s2 == 2) {
        data->animStateScaleX = 0;
        data->animStateScaleY = 0;
        exec_entity_commandlist(entity);
    }

    data->scaleAnimTimer++;
    if (data->scaleAnimTimer == 10 && data->linkedSwitch == NULL) {
        fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 60);
    }
}