### RAW ASSEMBLY INSTRUCTIONS:

glabel snowman_doll_update
/* 3BCEC0 E00C0160 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 3BCEC4 E00C0164 AFBF002C */  sw        $ra, 0x2C($sp)
/* 3BCEC8 E00C0168 AFB00028 */  sw        $s0, 0x28($sp)
/* 3BCECC E00C016C F7B40030 */  sdc1      $f20, 0x30($sp)
/* 3BCED0 E00C0170 8C830000 */  lw        $v1, 0x0($a0)
/* 3BCED4 E00C0174 8C90000C */  lw        $s0, 0xC($a0)
/* 3BCED8 E00C0178 30620010 */  andi      $v0, $v1, 0x10
/* 3BCEDC E00C017C 10400005 */  beqz      $v0, .LE00C0194
/* 3BCEE0 E00C0180 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3BCEE4 E00C0184 00621024 */  and       $v0, $v1, $v0
/* 3BCEE8 E00C0188 AC820000 */  sw        $v0, 0x0($a0)
/* 3BCEEC E00C018C 24020010 */  addiu     $v0, $zero, 0x10
/* 3BCEF0 E00C0190 AE020010 */  sw        $v0, 0x10($s0)
.LE00C0194:
/* 3BCEF4 E00C0194 8E030010 */  lw        $v1, 0x10($s0)
/* 3BCEF8 E00C0198 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3BCEFC E00C019C 10400002 */  beqz      $v0, .LE00C01A8
/* 3BCF00 E00C01A0 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3BCF04 E00C01A4 AE020010 */  sw        $v0, 0x10($s0)
.LE00C01A8:
/* 3BCF08 E00C01A8 8E020014 */  lw        $v0, 0x14($s0)
/* 3BCF0C E00C01AC 8E050010 */  lw        $a1, 0x10($s0)
/* 3BCF10 E00C01B0 24420001 */  addiu     $v0, $v0, 0x1
/* 3BCF14 E00C01B4 04A10005 */  bgez      $a1, .LE00C01CC
/* 3BCF18 E00C01B8 AE020014 */   sw       $v0, 0x14($s0)
/* 3BCF1C E00C01BC 0C080128 */  jal       shim_remove_effect
/* 3BCF20 E00C01C0 00000000 */   nop
/* 3BCF24 E00C01C4 080301BF */  j         .LE00C06FC
/* 3BCF28 E00C01C8 00000000 */   nop
.LE00C01CC:
/* 3BCF2C E00C01CC 0040302D */  daddu     $a2, $v0, $zero
/* 3BCF30 E00C01D0 28A20010 */  slti      $v0, $a1, 0x10
/* 3BCF34 E00C01D4 10400002 */  beqz      $v0, .LE00C01E0
/* 3BCF38 E00C01D8 00051100 */   sll      $v0, $a1, 4
/* 3BCF3C E00C01DC AE020024 */  sw        $v0, 0x24($s0)
.LE00C01E0:
/* 3BCF40 E00C01E0 28C20010 */  slti      $v0, $a2, 0x10
/* 3BCF44 E00C01E4 10400003 */  beqz      $v0, .LE00C01F4
/* 3BCF48 E00C01E8 00061100 */   sll      $v0, $a2, 4
/* 3BCF4C E00C01EC 2442000F */  addiu     $v0, $v0, 0xF
/* 3BCF50 E00C01F0 AE020024 */  sw        $v0, 0x24($s0)
.LE00C01F4:
/* 3BCF54 E00C01F4 C604003C */  lwc1      $f4, 0x3C($s0)
/* 3BCF58 E00C01F8 44800000 */  mtc1      $zero, $f0
/* 3BCF5C E00C01FC 00000000 */  nop
/* 3BCF60 E00C0200 46002032 */  c.eq.s    $f4, $f0
/* 3BCF64 E00C0204 00000000 */  nop
/* 3BCF68 E00C0208 45010010 */  bc1t      .LE00C024C
/* 3BCF6C E00C020C 00000000 */   nop
/* 3BCF70 E00C0210 C6020040 */  lwc1      $f2, 0x40($s0)
/* 3BCF74 E00C0214 4600103C */  c.lt.s    $f2, $f0
/* 3BCF78 E00C0218 00000000 */  nop
/* 3BCF7C E00C021C 45030001 */  bc1tl     .LE00C0224
/* 3BCF80 E00C0220 46001087 */   neg.s    $f2, $f2
.LE00C0224:
/* 3BCF84 E00C0224 4600203C */  c.lt.s    $f4, $f0
/* 3BCF88 E00C0228 00000000 */  nop
/* 3BCF8C E00C022C 45000004 */  bc1f      .LE00C0240
/* 3BCF90 E00C0230 00000000 */   nop
/* 3BCF94 E00C0234 C600002C */  lwc1      $f0, 0x2C($s0)
/* 3BCF98 E00C0238 08030092 */  j         .LE00C0248
/* 3BCF9C E00C023C 46020001 */   sub.s    $f0, $f0, $f2
.LE00C0240:
/* 3BCFA0 E00C0240 C600002C */  lwc1      $f0, 0x2C($s0)
/* 3BCFA4 E00C0244 46020000 */  add.s     $f0, $f0, $f2
.LE00C0248:
/* 3BCFA8 E00C0248 E600002C */  swc1      $f0, 0x2C($s0)
.LE00C024C:
/* 3BCFAC E00C024C 8E040058 */  lw        $a0, 0x58($s0)
/* 3BCFB0 E00C0250 24020001 */  addiu     $v0, $zero, 0x1
/* 3BCFB4 E00C0254 10820028 */  beq       $a0, $v0, .LE00C02F8
/* 3BCFB8 E00C0258 28820002 */   slti     $v0, $a0, 0x2
/* 3BCFBC E00C025C 10400005 */  beqz      $v0, .LE00C0274
/* 3BCFC0 E00C0260 24050002 */   addiu    $a1, $zero, 0x2
/* 3BCFC4 E00C0264 10800009 */  beqz      $a0, .LE00C028C
/* 3BCFC8 E00C0268 30C30007 */   andi     $v1, $a2, 0x7
/* 3BCFCC E00C026C 08030175 */  j         .LE00C05D4
/* 3BCFD0 E00C0270 24020001 */   addiu    $v0, $zero, 0x1
.LE00C0274:
/* 3BCFD4 E00C0274 10850075 */  beq       $a0, $a1, .LE00C044C
/* 3BCFD8 E00C0278 24020003 */   addiu    $v0, $zero, 0x3
/* 3BCFDC E00C027C 1082003B */  beq       $a0, $v0, .LE00C036C
/* 3BCFE0 E00C0280 30C30007 */   andi     $v1, $a2, 0x7
/* 3BCFE4 E00C0284 08030175 */  j         .LE00C05D4
/* 3BCFE8 E00C0288 24020001 */   addiu    $v0, $zero, 0x1
.LE00C028C:
/* 3BCFEC E00C028C 8E030054 */  lw        $v1, 0x54($s0)
/* 3BCFF0 E00C0290 3C02E00C */  lui       $v0, (0xE00C0A24 >> 16)
/* 3BCFF4 E00C0294 00431021 */  addu      $v0, $v0, $v1
/* 3BCFF8 E00C0298 90420A24 */  lbu       $v0, (0xE00C0A24 & 0xFFFF)($v0)
/* 3BCFFC E00C029C 3C01E00C */  lui       $at, (0xE00C0C00 >> 16)
/* 3BD000 E00C02A0 D4220C00 */  ldc1      $f2, (0xE00C0C00 & 0xFFFF)($at)
/* 3BD004 E00C02A4 44820000 */  mtc1      $v0, $f0
/* 3BD008 E00C02A8 00000000 */  nop
/* 3BD00C E00C02AC 46800020 */  cvt.s.w   $f0, $f0
/* 3BD010 E00C02B0 46000021 */  cvt.d.s   $f0, $f0
/* 3BD014 E00C02B4 46220002 */  mul.d     $f0, $f0, $f2
/* 3BD018 E00C02B8 00000000 */  nop
/* 3BD01C E00C02BC 46200020 */  cvt.s.d   $f0, $f0
/* 3BD020 E00C02C0 E600004C */  swc1      $f0, 0x4C($s0)
/* 3BD024 E00C02C4 46000086 */  mov.s     $f2, $f0
/* 3BD028 E00C02C8 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD02C E00C02CC 44810000 */  mtc1      $at, $f0
/* 3BD030 E00C02D0 24630001 */  addiu     $v1, $v1, 0x1
/* 3BD034 E00C02D4 AE030054 */  sw        $v1, 0x54($s0)
/* 3BD038 E00C02D8 46020001 */  sub.s     $f0, $f0, $f2
/* 3BD03C E00C02DC 0060102D */  daddu     $v0, $v1, $zero
/* 3BD040 E00C02E0 2842001B */  slti      $v0, $v0, 0x1B
/* 3BD044 E00C02E4 144000B9 */  bnez      $v0, .LE00C05CC
/* 3BD048 E00C02E8 E6000048 */   swc1     $f0, 0x48($s0)
/* 3BD04C E00C02EC 24020002 */  addiu     $v0, $zero, 0x2
/* 3BD050 E00C02F0 08030173 */  j         .LE00C05CC
/* 3BD054 E00C02F4 AE020058 */   sw       $v0, 0x58($s0)
.LE00C02F8:
/* 3BD058 E00C02F8 8E030054 */  lw        $v1, 0x54($s0)
/* 3BD05C E00C02FC 3C02E00C */  lui       $v0, (0xE00C0A10 >> 16)
/* 3BD060 E00C0300 00431021 */  addu      $v0, $v0, $v1
/* 3BD064 E00C0304 80420A10 */  lb        $v0, (0xE00C0A10 & 0xFFFF)($v0)
/* 3BD068 E00C0308 3C01E00C */  lui       $at, (0xE00C0C08 >> 16)
/* 3BD06C E00C030C D4220C08 */  ldc1      $f2, (0xE00C0C08 & 0xFFFF)($at)
/* 3BD070 E00C0310 44820000 */  mtc1      $v0, $f0
/* 3BD074 E00C0314 00000000 */  nop
/* 3BD078 E00C0318 46800020 */  cvt.s.w   $f0, $f0
/* 3BD07C E00C031C 46000021 */  cvt.d.s   $f0, $f0
/* 3BD080 E00C0320 46220002 */  mul.d     $f0, $f0, $f2
/* 3BD084 E00C0324 00000000 */  nop
/* 3BD088 E00C0328 46200020 */  cvt.s.d   $f0, $f0
/* 3BD08C E00C032C E600004C */  swc1      $f0, 0x4C($s0)
/* 3BD090 E00C0330 46000086 */  mov.s     $f2, $f0
/* 3BD094 E00C0334 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD098 E00C0338 44810000 */  mtc1      $at, $f0
/* 3BD09C E00C033C 24630001 */  addiu     $v1, $v1, 0x1
/* 3BD0A0 E00C0340 AE030054 */  sw        $v1, 0x54($s0)
/* 3BD0A4 E00C0344 46020001 */  sub.s     $f0, $f0, $f2
/* 3BD0A8 E00C0348 0060102D */  daddu     $v0, $v1, $zero
/* 3BD0AC E00C034C 28420012 */  slti      $v0, $v0, 0x12
/* 3BD0B0 E00C0350 14400003 */  bnez      $v0, .LE00C0360
/* 3BD0B4 E00C0354 E6000048 */   swc1     $f0, 0x48($s0)
/* 3BD0B8 E00C0358 24020002 */  addiu     $v0, $zero, 0x2
/* 3BD0BC E00C035C AE020058 */  sw        $v0, 0x58($s0)
.LE00C0360:
/* 3BD0C0 E00C0360 8E020054 */  lw        $v0, 0x54($s0)
/* 3BD0C4 E00C0364 080300FF */  j         .LE00C03FC
/* 3BD0C8 E00C0368 28420008 */   slti     $v0, $v0, 0x8
.LE00C036C:
/* 3BD0CC E00C036C 8E030054 */  lw        $v1, 0x54($s0)
/* 3BD0D0 E00C0370 3C02E00C */  lui       $v0, (0xE00C0A40 >> 16)
/* 3BD0D4 E00C0374 00431021 */  addu      $v0, $v0, $v1
/* 3BD0D8 E00C0378 90420A40 */  lbu       $v0, (0xE00C0A40 & 0xFFFF)($v0)
/* 3BD0DC E00C037C 3C01E00C */  lui       $at, (0xE00C0C10 >> 16)
/* 3BD0E0 E00C0380 D4220C10 */  ldc1      $f2, (0xE00C0C10 & 0xFFFF)($at)
/* 3BD0E4 E00C0384 44820000 */  mtc1      $v0, $f0
/* 3BD0E8 E00C0388 00000000 */  nop
/* 3BD0EC E00C038C 46800020 */  cvt.s.w   $f0, $f0
/* 3BD0F0 E00C0390 46000021 */  cvt.d.s   $f0, $f0
/* 3BD0F4 E00C0394 46220002 */  mul.d     $f0, $f0, $f2
/* 3BD0F8 E00C0398 00000000 */  nop
/* 3BD0FC E00C039C 46200020 */  cvt.s.d   $f0, $f0
/* 3BD100 E00C03A0 E600004C */  swc1      $f0, 0x4C($s0)
/* 3BD104 E00C03A4 46000086 */  mov.s     $f2, $f0
/* 3BD108 E00C03A8 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD10C E00C03AC 44810000 */  mtc1      $at, $f0
/* 3BD110 E00C03B0 24630001 */  addiu     $v1, $v1, 0x1
/* 3BD114 E00C03B4 46020001 */  sub.s     $f0, $f0, $f2
/* 3BD118 E00C03B8 AE030054 */  sw        $v1, 0x54($s0)
/* 3BD11C E00C03BC 0060102D */  daddu     $v0, $v1, $zero
/* 3BD120 E00C03C0 E6000048 */  swc1      $f0, 0x48($s0)
/* 3BD124 E00C03C4 3C03E00C */  lui       $v1, (0xE00C0A8C >> 16)
/* 3BD128 E00C03C8 00621821 */  addu      $v1, $v1, $v0
/* 3BD12C E00C03CC 80630A8C */  lb        $v1, (0xE00C0A8C & 0xFFFF)($v1)
/* 3BD130 E00C03D0 24420001 */  addiu     $v0, $v0, 0x1
/* 3BD134 E00C03D4 AE020054 */  sw        $v0, 0x54($s0)
/* 3BD138 E00C03D8 2842004A */  slti      $v0, $v0, 0x4A
/* 3BD13C E00C03DC 44830000 */  mtc1      $v1, $f0
/* 3BD140 E00C03E0 00000000 */  nop
/* 3BD144 E00C03E4 46800020 */  cvt.s.w   $f0, $f0
/* 3BD148 E00C03E8 14400002 */  bnez      $v0, .LE00C03F4
/* 3BD14C E00C03EC E600002C */   swc1     $f0, 0x2C($s0)
/* 3BD150 E00C03F0 AE050058 */  sw        $a1, 0x58($s0)
.LE00C03F4:
/* 3BD154 E00C03F4 8E020054 */  lw        $v0, 0x54($s0)
/* 3BD158 E00C03F8 28420040 */  slti      $v0, $v0, 0x40
.LE00C03FC:
/* 3BD15C E00C03FC 14400074 */  bnez      $v0, .LE00C05D0
/* 3BD160 E00C0400 30C30007 */   andi     $v1, $a2, 0x7
/* 3BD164 E00C0404 C6080030 */  lwc1      $f8, 0x30($s0)
/* 3BD168 E00C0408 C600003C */  lwc1      $f0, 0x3C($s0)
/* 3BD16C E00C040C C6060034 */  lwc1      $f6, 0x34($s0)
/* 3BD170 E00C0410 46004200 */  add.s     $f8, $f8, $f0
/* 3BD174 E00C0414 C6000040 */  lwc1      $f0, 0x40($s0)
/* 3BD178 E00C0418 C6020038 */  lwc1      $f2, 0x38($s0)
/* 3BD17C E00C041C 46003180 */  add.s     $f6, $f6, $f0
/* 3BD180 E00C0420 C6000044 */  lwc1      $f0, 0x44($s0)
/* 3BD184 E00C0424 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 3BD188 E00C0428 44812000 */  mtc1      $at, $f4
/* 3BD18C E00C042C 46001080 */  add.s     $f2, $f2, $f0
/* 3BD190 E00C0430 C6000040 */  lwc1      $f0, 0x40($s0)
/* 3BD194 E00C0434 E6080030 */  swc1      $f8, 0x30($s0)
/* 3BD198 E00C0438 46040000 */  add.s     $f0, $f0, $f4
/* 3BD19C E00C043C E6060034 */  swc1      $f6, 0x34($s0)
/* 3BD1A0 E00C0440 E6020038 */  swc1      $f2, 0x38($s0)
/* 3BD1A4 E00C0444 08030174 */  j         .LE00C05D0
/* 3BD1A8 E00C0448 E6000040 */   swc1     $f0, 0x40($s0)
.LE00C044C:
/* 3BD1AC E00C044C 3C02E00C */  lui       $v0, (0xE00C0A21 >> 16)
/* 3BD1B0 E00C0450 80420A21 */  lb        $v0, (0xE00C0A21 & 0xFFFF)($v0)
/* 3BD1B4 E00C0454 3C01E00C */  lui       $at, (0xE00C0C18 >> 16)
/* 3BD1B8 E00C0458 D4220C18 */  ldc1      $f2, (0xE00C0C18 & 0xFFFF)($at)
/* 3BD1BC E00C045C 44820000 */  mtc1      $v0, $f0
/* 3BD1C0 E00C0460 00000000 */  nop
/* 3BD1C4 E00C0464 46800020 */  cvt.s.w   $f0, $f0
/* 3BD1C8 E00C0468 46000021 */  cvt.d.s   $f0, $f0
/* 3BD1CC E00C046C 46220002 */  mul.d     $f0, $f0, $f2
/* 3BD1D0 E00C0470 00000000 */  nop
/* 3BD1D4 E00C0474 C6060030 */  lwc1      $f6, 0x30($s0)
/* 3BD1D8 E00C0478 C602003C */  lwc1      $f2, 0x3C($s0)
/* 3BD1DC E00C047C C6040034 */  lwc1      $f4, 0x34($s0)
/* 3BD1E0 E00C0480 46023180 */  add.s     $f6, $f6, $f2
/* 3BD1E4 E00C0484 C6020040 */  lwc1      $f2, 0x40($s0)
/* 3BD1E8 E00C0488 C6080038 */  lwc1      $f8, 0x38($s0)
/* 3BD1EC E00C048C 46022100 */  add.s     $f4, $f4, $f2
/* 3BD1F0 E00C0490 C6020044 */  lwc1      $f2, 0x44($s0)
/* 3BD1F4 E00C0494 44805000 */  mtc1      $zero, $f10
/* 3BD1F8 E00C0498 46024200 */  add.s     $f8, $f8, $f2
/* 3BD1FC E00C049C C6020050 */  lwc1      $f2, 0x50($s0)
/* 3BD200 E00C04A0 E6040034 */  swc1      $f4, 0x34($s0)
/* 3BD204 E00C04A4 C6040040 */  lwc1      $f4, 0x40($s0)
/* 3BD208 E00C04A8 E6060030 */  swc1      $f6, 0x30($s0)
/* 3BD20C E00C04AC 46022100 */  add.s     $f4, $f4, $f2
/* 3BD210 E00C04B0 C6060034 */  lwc1      $f6, 0x34($s0)
/* 3BD214 E00C04B4 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD218 E00C04B8 44811000 */  mtc1      $at, $f2
/* 3BD21C E00C04BC 460A303C */  c.lt.s    $f6, $f10
/* 3BD220 E00C04C0 E6080038 */  swc1      $f8, 0x38($s0)
/* 3BD224 E00C04C4 46200020 */  cvt.s.d   $f0, $f0
/* 3BD228 E00C04C8 46001081 */  sub.s     $f2, $f2, $f0
/* 3BD22C E00C04CC E6040040 */  swc1      $f4, 0x40($s0)
/* 3BD230 E00C04D0 E600004C */  swc1      $f0, 0x4C($s0)
/* 3BD234 E00C04D4 4500003D */  bc1f      .LE00C05CC
/* 3BD238 E00C04D8 E6020048 */   swc1     $f2, 0x48($s0)
/* 3BD23C E00C04DC 8E03005C */  lw        $v1, 0x5C($s0)
/* 3BD240 E00C04E0 2C620005 */  sltiu     $v0, $v1, 0x5
/* 3BD244 E00C04E4 1040002F */  beqz      $v0, .LE00C05A4
/* 3BD248 E00C04E8 00031080 */   sll      $v0, $v1, 2
/* 3BD24C E00C04EC 3C01E00C */  lui       $at, (0xE00C0C20 >> 16)
/* 3BD250 E00C04F0 00220821 */  addu      $at, $at, $v0
/* 3BD254 E00C04F4 8C220C20 */  lw        $v0, (0xE00C0C20 & 0xFFFF)($at)
/* 3BD258 E00C04F8 00400008 */  jr        $v0
/* 3BD25C E00C04FC 00000000 */   nop
/* 3BD260 E00C0500 0803016E */  j         .LE00C05B8
/* 3BD264 E00C0504 AE000058 */   sw       $zero, 0x58($s0)
/* 3BD268 E00C0508 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD26C E00C050C 44810000 */  mtc1      $at, $f0
/* 3BD270 E00C0510 08030154 */  j         .LE00C0550
/* 3BD274 E00C0514 00000000 */   nop
/* 3BD278 E00C0518 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD27C E00C051C 44810000 */  mtc1      $at, $f0
/* 3BD280 E00C0520 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 3BD284 E00C0524 44811000 */  mtc1      $at, $f2
/* 3BD288 E00C0528 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3BD28C E00C052C 44812000 */  mtc1      $at, $f4
/* 3BD290 E00C0530 24020001 */  addiu     $v0, $zero, 0x1
/* 3BD294 E00C0534 AE020058 */  sw        $v0, 0x58($s0)
/* 3BD298 E00C0538 E600003C */  swc1      $f0, 0x3C($s0)
/* 3BD29C E00C053C E6020044 */  swc1      $f2, 0x44($s0)
/* 3BD2A0 E00C0540 0803016E */  j         .LE00C05B8
/* 3BD2A4 E00C0544 E6040040 */   swc1     $f4, 0x40($s0)
/* 3BD2A8 E00C0548 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 3BD2AC E00C054C 44810000 */  mtc1      $at, $f0
.LE00C0550:
/* 3BD2B0 E00C0550 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3BD2B4 E00C0554 44811000 */  mtc1      $at, $f2
/* 3BD2B8 E00C0558 24020001 */  addiu     $v0, $zero, 0x1
/* 3BD2BC E00C055C AE020058 */  sw        $v0, 0x58($s0)
/* 3BD2C0 E00C0560 E600003C */  swc1      $f0, 0x3C($s0)
/* 3BD2C4 E00C0564 E6000044 */  swc1      $f0, 0x44($s0)
/* 3BD2C8 E00C0568 0803016E */  j         .LE00C05B8
/* 3BD2CC E00C056C E6020040 */   swc1     $f2, 0x40($s0)
/* 3BD2D0 E00C0570 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3BD2D4 E00C0574 44810000 */  mtc1      $at, $f0
/* 3BD2D8 E00C0578 3C014160 */  lui       $at, (0x41600000 >> 16)
/* 3BD2DC E00C057C 44811000 */  mtc1      $at, $f2
/* 3BD2E0 E00C0580 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 3BD2E4 E00C0584 44812000 */  mtc1      $at, $f4
/* 3BD2E8 E00C0588 24020001 */  addiu     $v0, $zero, 0x1
/* 3BD2EC E00C058C AE000044 */  sw        $zero, 0x44($s0)
/* 3BD2F0 E00C0590 AE020058 */  sw        $v0, 0x58($s0)
/* 3BD2F4 E00C0594 E600003C */  swc1      $f0, 0x3C($s0)
/* 3BD2F8 E00C0598 E6020040 */  swc1      $f2, 0x40($s0)
/* 3BD2FC E00C059C 0803016E */  j         .LE00C05B8
/* 3BD300 E00C05A0 E6040050 */   swc1     $f4, 0x50($s0)
.LE00C05A4:
/* 3BD304 E00C05A4 E60A003C */  swc1      $f10, 0x3C($s0)
/* 3BD308 E00C05A8 E60A0040 */  swc1      $f10, 0x40($s0)
/* 3BD30C E00C05AC E60A0044 */  swc1      $f10, 0x44($s0)
/* 3BD310 E00C05B0 E60A0034 */  swc1      $f10, 0x34($s0)
/* 3BD314 E00C05B4 AE040058 */  sw        $a0, 0x58($s0)
.LE00C05B8:
/* 3BD318 E00C05B8 8E02005C */  lw        $v0, 0x5C($s0)
/* 3BD31C E00C05BC AE000034 */  sw        $zero, 0x34($s0)
/* 3BD320 E00C05C0 AE000054 */  sw        $zero, 0x54($s0)
/* 3BD324 E00C05C4 24420001 */  addiu     $v0, $v0, 0x1
/* 3BD328 E00C05C8 AE02005C */  sw        $v0, 0x5C($s0)
.LE00C05CC:
/* 3BD32C E00C05CC 30C30007 */  andi      $v1, $a2, 0x7
.LE00C05D0:
/* 3BD330 E00C05D0 24020001 */  addiu     $v0, $zero, 0x1
.LE00C05D4:
/* 3BD334 E00C05D4 14620049 */  bne       $v1, $v0, .LE00C06FC
/* 3BD338 E00C05D8 00000000 */   nop
/* 3BD33C E00C05DC 0C080150 */  jal       shim_load_effect
/* 3BD340 E00C05E0 2404006F */   addiu    $a0, $zero, 0x6F
/* 3BD344 E00C05E4 0C080138 */  jal       shim_rand_int
/* 3BD348 E00C05E8 2404003C */   addiu    $a0, $zero, 0x3C
/* 3BD34C E00C05EC C6140004 */  lwc1      $f20, 0x4($s0)
/* 3BD350 E00C05F0 C6000030 */  lwc1      $f0, 0x30($s0)
/* 3BD354 E00C05F4 4600A500 */  add.s     $f20, $f20, $f0
/* 3BD358 E00C05F8 44820000 */  mtc1      $v0, $f0
/* 3BD35C E00C05FC 00000000 */  nop
/* 3BD360 E00C0600 46800020 */  cvt.s.w   $f0, $f0
/* 3BD364 E00C0604 4600A500 */  add.s     $f20, $f20, $f0
/* 3BD368 E00C0608 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 3BD36C E00C060C 44810000 */  mtc1      $at, $f0
/* 3BD370 E00C0610 24040064 */  addiu     $a0, $zero, 0x64
/* 3BD374 E00C0614 0C080138 */  jal       shim_rand_int
/* 3BD378 E00C0618 4600A501 */   sub.s    $f20, $f20, $f0
/* 3BD37C E00C061C C602000C */  lwc1      $f2, 0xC($s0)
/* 3BD380 E00C0620 C6000038 */  lwc1      $f0, 0x38($s0)
/* 3BD384 E00C0624 46001080 */  add.s     $f2, $f2, $f0
/* 3BD388 E00C0628 C6000034 */  lwc1      $f0, 0x34($s0)
/* 3BD38C E00C062C 44071000 */  mfc1      $a3, $f2
/* 3BD390 E00C0630 C6020008 */  lwc1      $f2, 0x8($s0)
/* 3BD394 E00C0634 46001080 */  add.s     $f2, $f2, $f0
/* 3BD398 E00C0638 44820000 */  mtc1      $v0, $f0
/* 3BD39C E00C063C 00000000 */  nop
/* 3BD3A0 E00C0640 46800020 */  cvt.s.w   $f0, $f0
/* 3BD3A4 E00C0644 46001080 */  add.s     $f2, $f2, $f0
/* 3BD3A8 E00C0648 3C014248 */  lui       $at, (0x42480000 >> 16)
/* 3BD3AC E00C064C 44810000 */  mtc1      $at, $f0
/* 3BD3B0 E00C0650 24040002 */  addiu     $a0, $zero, 0x2
/* 3BD3B4 E00C0654 46001080 */  add.s     $f2, $f2, $f0
/* 3BD3B8 E00C0658 4405A000 */  mfc1      $a1, $f20
/* 3BD3BC E00C065C 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3BD3C0 E00C0660 44810000 */  mtc1      $at, $f0
/* 3BD3C4 E00C0664 44061000 */  mfc1      $a2, $f2
/* 3BD3C8 E00C0668 24020028 */  addiu     $v0, $zero, 0x28
/* 3BD3CC E00C066C AFA20014 */  sw        $v0, 0x14($sp)
/* 3BD3D0 E00C0670 0C037800 */  jal       cold_breath_main
/* 3BD3D4 E00C0674 E7A00010 */   swc1     $f0, 0x10($sp)
/* 3BD3D8 E00C0678 0C080150 */  jal       shim_load_effect
/* 3BD3DC E00C067C 24040072 */   addiu    $a0, $zero, 0x72
/* 3BD3E0 E00C0680 C6020004 */  lwc1      $f2, 0x4($s0)
/* 3BD3E4 E00C0684 C6000030 */  lwc1      $f0, 0x30($s0)
/* 3BD3E8 E00C0688 46001080 */  add.s     $f2, $f2, $f0
/* 3BD3EC E00C068C 24040001 */  addiu     $a0, $zero, 0x1
/* 3BD3F0 E00C0690 C6000034 */  lwc1      $f0, 0x34($s0)
/* 3BD3F4 E00C0694 44051000 */  mfc1      $a1, $f2
/* 3BD3F8 E00C0698 C6020008 */  lwc1      $f2, 0x8($s0)
/* 3BD3FC E00C069C C6080038 */  lwc1      $f8, 0x38($s0)
/* 3BD400 E00C06A0 46001080 */  add.s     $f2, $f2, $f0
/* 3BD404 E00C06A4 C600000C */  lwc1      $f0, 0xC($s0)
/* 3BD408 E00C06A8 2402000A */  addiu     $v0, $zero, 0xA
/* 3BD40C E00C06AC 46080000 */  add.s     $f0, $f0, $f8
/* 3BD410 E00C06B0 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3BD414 E00C06B4 44812000 */  mtc1      $at, $f4
/* 3BD418 E00C06B8 3C014270 */  lui       $at, (0x42700000 >> 16)
/* 3BD41C E00C06BC 44813000 */  mtc1      $at, $f6
/* 3BD420 E00C06C0 46041080 */  add.s     $f2, $f2, $f4
/* 3BD424 E00C06C4 AFA2001C */  sw        $v0, 0x1C($sp)
/* 3BD428 E00C06C8 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3BD42C E00C06CC 44812000 */  mtc1      $at, $f4
/* 3BD430 E00C06D0 46060000 */  add.s     $f0, $f0, $f6
/* 3BD434 E00C06D4 44061000 */  mfc1      $a2, $f2
/* 3BD438 E00C06D8 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 3BD43C E00C06DC 44811000 */  mtc1      $at, $f2
/* 3BD440 E00C06E0 44070000 */  mfc1      $a3, $f0
/* 3BD444 E00C06E4 2402001E */  addiu     $v0, $zero, 0x1E
/* 3BD448 E00C06E8 AFA20020 */  sw        $v0, 0x20($sp)
/* 3BD44C E00C06EC E7A60010 */  swc1      $f6, 0x10($sp)
/* 3BD450 E00C06F0 E7A40018 */  swc1      $f4, 0x18($sp)
/* 3BD454 E00C06F4 0C039000 */  jal       misc_particles_main
/* 3BD458 E00C06F8 E7A20014 */   swc1     $f2, 0x14($sp)
.LE00C06FC:
/* 3BD45C E00C06FC 8FBF002C */  lw        $ra, 0x2C($sp)
/* 3BD460 E00C0700 8FB00028 */  lw        $s0, 0x28($sp)
/* 3BD464 E00C0704 D7B40030 */  ldc1      $f20, 0x30($sp)
/* 3BD468 E00C0708 03E00008 */  jr        $ra
/* 3BD46C E00C070C 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

void snowman_doll_update(EffectInstance* effect) {
    SnowmanDollFXData* data = effect->data.snowmanDoll;
    s32 unk_14;
    s32 unk_58;

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

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

    data->unk_14++;

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

    unk_14 = data->unk_14;

    if (data->unk_10 < 16) {
        data->unk_24 = data->unk_10 * 16;
    }

    if (unk_14 < 16) {
        data->unk_24 = unk_14 * 16 + 15;
    }

    if (data->unk_3C != 0.0f) {
        f32 unk_40 = data->unk_40;

        if (unk_40 < 0.0f) {
            unk_40 = -unk_40;
        }

        if (data->unk_3C < 0.0f) {
            data->unk_2C -= unk_40;
        } else {
            data->unk_2C += unk_40;
        }
    }

    unk_58 = data->unk_58;

    switch (unk_58) {
        case 0:
            data->unk_4C = (f32) D_E00C0A24[data->unk_54++] * 0.01;
            data->unk_48 = 2.0f - data->unk_4C;
            if (data->unk_54 >= ARRAY_COUNT(D_E00C0A24)) {
                data->unk_58 = 2;
            }
            break;
        case 1:
            data->unk_4C = (f32) D_E00C0A10[data->unk_54++] * 0.01;
            data->unk_48 = 2.0f - data->unk_4C;
            if (data->unk_54 >= ARRAY_COUNT(D_E00C0A10) + 1) {
                data->unk_58 = 2;
            }
            if (data->unk_54 >= 8) {
                data->unk_30 += data->unk_3C;
                data->unk_34 += data->unk_40;
                data->unk_38 += data->unk_44;
                data->unk_40 += -1.0f;
            }
            break;
        case 3:
            data->unk_4C = (f32) D_E00C0A40[data->unk_54++] * 0.01;
            data->unk_48 = 2.0f - data->unk_4C;
            data->unk_2C = D_E00C0A8C[data->unk_54++];
            if (data->unk_54 >= ARRAY_COUNT(D_E00C0A40)) {
                data->unk_58 = 2;
            }
            if (data->unk_54 >= 64) {
                data->unk_30 += data->unk_3C;
                data->unk_34 += data->unk_40;
                data->unk_38 += data->unk_44;
                data->unk_40 += -1.0f;
            }
            break;
        case 2:
            data->unk_30 += data->unk_3C;
            data->unk_34 += data->unk_40;
            data->unk_38 += data->unk_44;
            data->unk_40 += data->unk_50;
            data->unk_4C = (f32) D_E00C0A21 * 0.01;
            data->unk_48 = 2.0f - data->unk_4C;
            if (data->unk_34 < 0.0f) {
                switch (data->unk_5C) {
                    case 0:
                        data->unk_58 = 0;
                        break;
                    case 1:
                        data->unk_58 = 1;
                        data->unk_3C = 2.0f;
                        data->unk_44 = 2.0f;
                        data->unk_40 = 10.0f;
                        break;
                    case 2:
                        data->unk_58 = 1;
                        data->unk_3C = 2.0f;
                        data->unk_44 = -2.0f;
                        data->unk_40 = 10.0f;
                        break;
                    case 3:
                        data->unk_58 = 1;
                        data->unk_3C = -2.0f;
                        data->unk_44 = -2.0f;
                        data->unk_40 = 10.0f;
                        break;
                    case 4:
                        data->unk_44 = 0.0f;
                        data->unk_58 = 1;
                        data->unk_3C = 10.0f;
                        data->unk_40 = 14.0f;
                        data->unk_50 = -1.0f;
                        break;
                    default:
                        data->unk_3C = 0.0f;
                        data->unk_40 = 0.0f;
                        data->unk_44 = 0.0f;
                        data->unk_34 = 0.0f;
                        data->unk_58 = unk_58;
                        break;
                }
                data->unk_34 = 0.0f;
                data->unk_54 = 0;
                data->unk_5C++;
            }
            break;
    }

    if ((unk_14 & 7) == 1) {
        shim_load_effect(EFFECT_COLD_BREATH);
        cold_breath_main(2,
            data->unk_04 + data->unk_30 + shim_rand_int(60) - 30.0f,
            data->unk_08 + data->unk_34 + shim_rand_int(100) + 50.0f,
            data->unk_0C + data->unk_38,
            4.0f, 40);
        shim_load_effect(EFFECT_MISC_PARTICLES);
        misc_particles_main(1,
            data->unk_04 + data->unk_30,
            data->unk_08 + data->unk_34 + 10.0f,
            data->unk_0C + data->unk_38 + 60.0f,
            60.0f, 100.0f, 2.0f, 10, 30);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel test_ray_triangle_general
/* 37284 8005BE84 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 37288 8005BE88 F7BE0038 */  sdc1      $f30, 0x38($sp)
/* 3728C 8005BE8C F7BC0030 */  sdc1      $f28, 0x30($sp)
/* 37290 8005BE90 F7BA0028 */  sdc1      $f26, 0x28($sp)
/* 37294 8005BE94 F7B80020 */  sdc1      $f24, 0x20($sp)
/* 37298 8005BE98 F7B60018 */  sdc1      $f22, 0x18($sp)
/* 3729C 8005BE9C F7B40010 */  sdc1      $f20, 0x10($sp)
/* 372A0 8005BEA0 C4800030 */  lwc1      $f0, 0x30($a0)
/* 372A4 8005BEA4 44801000 */  mtc1      $zero, $f2
/* 372A8 8005BEA8 00000000 */  nop
/* 372AC 8005BEAC 46020032 */  c.eq.s    $f0, $f2
/* 372B0 8005BEB0 00000000 */  nop
/* 372B4 8005BEB4 4500000B */  bc1f      .L8005BEE4
/* 372B8 8005BEB8 00000000 */   nop
/* 372BC 8005BEBC C4800034 */  lwc1      $f0, 0x34($a0)
/* 372C0 8005BEC0 46020032 */  c.eq.s    $f0, $f2
/* 372C4 8005BEC4 00000000 */  nop
/* 372C8 8005BEC8 45000006 */  bc1f      .L8005BEE4
/* 372CC 8005BECC 00000000 */   nop
/* 372D0 8005BED0 C4800038 */  lwc1      $f0, 0x38($a0)
/* 372D4 8005BED4 46020032 */  c.eq.s    $f0, $f2
/* 372D8 8005BED8 00000000 */  nop
/* 372DC 8005BEDC 45010167 */  bc1t      .L8005C47C
/* 372E0 8005BEE0 0000102D */   daddu    $v0, $zero, $zero
.L8005BEE4:
/* 372E4 8005BEE4 8C820000 */  lw        $v0, 0x0($a0)
/* 372E8 8005BEE8 3C01800A */  lui       $at, %hi(gCollisionRayStartX)
/* 372EC 8005BEEC C43A4230 */  lwc1      $f26, %lo(gCollisionRayStartX)($at)
/* 372F0 8005BEF0 C4400000 */  lwc1      $f0, 0x0($v0)
/* 372F4 8005BEF4 4600D001 */  sub.s     $f0, $f26, $f0
/* 372F8 8005BEF8 E7A00008 */  swc1      $f0, 0x8($sp)
/* 372FC 8005BEFC C48A0030 */  lwc1      $f10, 0x30($a0)
/* 37300 8005BF00 46005082 */  mul.s     $f2, $f10, $f0
/* 37304 8005BF04 00000000 */  nop
/* 37308 8005BF08 3C01800A */  lui       $at, %hi(gCollisionRayStartY)
/* 3730C 8005BF0C C43C4234 */  lwc1      $f28, %lo(gCollisionRayStartY)($at)
/* 37310 8005BF10 C4400004 */  lwc1      $f0, 0x4($v0)
/* 37314 8005BF14 4600E601 */  sub.s     $f24, $f28, $f0
/* 37318 8005BF18 C4880034 */  lwc1      $f8, 0x34($a0)
/* 3731C 8005BF1C 3C01800A */  lui       $at, %hi(gCollisionRayStartZ)
/* 37320 8005BF20 C4324238 */  lwc1      $f18, %lo(gCollisionRayStartZ)($at)
/* 37324 8005BF24 46184102 */  mul.s     $f4, $f8, $f24
/* 37328 8005BF28 00000000 */  nop
/* 3732C 8005BF2C E7B20000 */  swc1      $f18, 0x0($sp)
/* 37330 8005BF30 C4400008 */  lwc1      $f0, 0x8($v0)
/* 37334 8005BF34 46009581 */  sub.s     $f22, $f18, $f0
/* 37338 8005BF38 C4860038 */  lwc1      $f6, 0x38($a0)
/* 3733C 8005BF3C 46163002 */  mul.s     $f0, $f6, $f22
/* 37340 8005BF40 00000000 */  nop
/* 37344 8005BF44 8C830004 */  lw        $v1, 0x4($a0)
/* 37348 8005BF48 46041080 */  add.s     $f2, $f2, $f4
/* 3734C 8005BF4C 8C850008 */  lw        $a1, 0x8($a0)
/* 37350 8005BF50 8482003C */  lh        $v0, 0x3C($a0)
/* 37354 8005BF54 1040007E */  beqz      $v0, .L8005C150
/* 37358 8005BF58 46001500 */   add.s    $f20, $f2, $f0
/* 3735C 8005BF5C 4480F000 */  mtc1      $zero, $f30
/* 37360 8005BF60 00000000 */  nop
/* 37364 8005BF64 461EA03C */  c.lt.s    $f20, $f30
/* 37368 8005BF68 00000000 */  nop
/* 3736C 8005BF6C 45030143 */  bc1tl     .L8005C47C
/* 37370 8005BF70 0000102D */   daddu    $v0, $zero, $zero
/* 37374 8005BF74 3C01800A */  lui       $at, %hi(gCollisionRayDirX)
/* 37378 8005BF78 C430423C */  lwc1      $f16, %lo(gCollisionRayDirX)($at)
/* 3737C 8005BF7C 46105002 */  mul.s     $f0, $f10, $f16
/* 37380 8005BF80 00000000 */  nop
/* 37384 8005BF84 3C01800A */  lui       $at, %hi(gCollisionRayDirY)
/* 37388 8005BF88 C42E4240 */  lwc1      $f14, %lo(gCollisionRayDirY)($at)
/* 3738C 8005BF8C 460E4102 */  mul.s     $f4, $f8, $f14
/* 37390 8005BF90 00000000 */  nop
/* 37394 8005BF94 3C01800A */  lui       $at, %hi(gCollisionRayDirZ)
/* 37398 8005BF98 C42C4244 */  lwc1      $f12, %lo(gCollisionRayDirZ)($at)
/* 3739C 8005BF9C 460C3082 */  mul.s     $f2, $f6, $f12
/* 373A0 8005BFA0 00000000 */  nop
/* 373A4 8005BFA4 46040000 */  add.s     $f0, $f0, $f4
/* 373A8 8005BFA8 46020000 */  add.s     $f0, $f0, $f2
/* 373AC 8005BFAC 4600F03E */  c.le.s    $f30, $f0
/* 373B0 8005BFB0 00000000 */  nop
/* 373B4 8005BFB4 45010131 */  bc1t      .L8005C47C
/* 373B8 8005BFB8 0000102D */   daddu    $v0, $zero, $zero
/* 373BC 8005BFBC C4880014 */  lwc1      $f8, 0x14($a0)
/* 373C0 8005BFC0 460E4102 */  mul.s     $f4, $f8, $f14
/* 373C4 8005BFC4 00000000 */  nop
/* 373C8 8005BFC8 C4820010 */  lwc1      $f2, 0x10($a0)
/* 373CC 8005BFCC 460C1002 */  mul.s     $f0, $f2, $f12
/* 373D0 8005BFD0 00000000 */  nop
/* 373D4 8005BFD4 46104202 */  mul.s     $f8, $f8, $f16
/* 373D8 8005BFD8 00000000 */  nop
/* 373DC 8005BFDC 46101082 */  mul.s     $f2, $f2, $f16
/* 373E0 8005BFE0 00000000 */  nop
/* 373E4 8005BFE4 46002101 */  sub.s     $f4, $f4, $f0
/* 373E8 8005BFE8 C486000C */  lwc1      $f6, 0xC($a0)
/* 373EC 8005BFEC 460C3002 */  mul.s     $f0, $f6, $f12
/* 373F0 8005BFF0 00000000 */  nop
/* 373F4 8005BFF4 460E3182 */  mul.s     $f6, $f6, $f14
/* 373F8 8005BFF8 00000000 */  nop
/* 373FC 8005BFFC C7B20008 */  lwc1      $f18, 0x8($sp)
/* 37400 8005C000 46049102 */  mul.s     $f4, $f18, $f4
/* 37404 8005C004 00000000 */  nop
/* 37408 8005C008 46080001 */  sub.s     $f0, $f0, $f8
/* 3740C 8005C00C 4600C002 */  mul.s     $f0, $f24, $f0
/* 37410 8005C010 00000000 */  nop
/* 37414 8005C014 46061081 */  sub.s     $f2, $f2, $f6
/* 37418 8005C018 4602B082 */  mul.s     $f2, $f22, $f2
/* 3741C 8005C01C 00000000 */  nop
/* 37420 8005C020 46002100 */  add.s     $f4, $f4, $f0
/* 37424 8005C024 46022100 */  add.s     $f4, $f4, $f2
/* 37428 8005C028 461E203C */  c.lt.s    $f4, $f30
/* 3742C 8005C02C 00000000 */  nop
/* 37430 8005C030 45010112 */  bc1t      .L8005C47C
/* 37434 8005C034 00000000 */   nop
/* 37438 8005C038 C48A0020 */  lwc1      $f10, 0x20($a0)
/* 3743C 8005C03C 460E5002 */  mul.s     $f0, $f10, $f14
/* 37440 8005C040 00000000 */  nop
/* 37444 8005C044 C488001C */  lwc1      $f8, 0x1C($a0)
/* 37448 8005C048 460C4102 */  mul.s     $f4, $f8, $f12
/* 3744C 8005C04C 00000000 */  nop
/* 37450 8005C050 46105282 */  mul.s     $f10, $f10, $f16
/* 37454 8005C054 00000000 */  nop
/* 37458 8005C058 46104202 */  mul.s     $f8, $f8, $f16
/* 3745C 8005C05C 00000000 */  nop
/* 37460 8005C060 C4620000 */  lwc1      $f2, 0x0($v1)
/* 37464 8005C064 4602D081 */  sub.s     $f2, $f26, $f2
/* 37468 8005C068 46040001 */  sub.s     $f0, $f0, $f4
/* 3746C 8005C06C 46001082 */  mul.s     $f2, $f2, $f0
/* 37470 8005C070 00000000 */  nop
/* 37474 8005C074 C4860018 */  lwc1      $f6, 0x18($a0)
/* 37478 8005C078 460C3002 */  mul.s     $f0, $f6, $f12
/* 3747C 8005C07C 00000000 */  nop
/* 37480 8005C080 460E3182 */  mul.s     $f6, $f6, $f14
/* 37484 8005C084 00000000 */  nop
/* 37488 8005C088 C4640004 */  lwc1      $f4, 0x4($v1)
/* 3748C 8005C08C 4604E101 */  sub.s     $f4, $f28, $f4
/* 37490 8005C090 460A0001 */  sub.s     $f0, $f0, $f10
/* 37494 8005C094 46002102 */  mul.s     $f4, $f4, $f0
/* 37498 8005C098 00000000 */  nop
/* 3749C 8005C09C C7B20000 */  lwc1      $f18, 0x0($sp)
/* 374A0 8005C0A0 46064201 */  sub.s     $f8, $f8, $f6
/* 374A4 8005C0A4 C4600008 */  lwc1      $f0, 0x8($v1)
/* 374A8 8005C0A8 46009001 */  sub.s     $f0, $f18, $f0
/* 374AC 8005C0AC 46080002 */  mul.s     $f0, $f0, $f8
/* 374B0 8005C0B0 00000000 */  nop
/* 374B4 8005C0B4 46041080 */  add.s     $f2, $f2, $f4
/* 374B8 8005C0B8 46001080 */  add.s     $f2, $f2, $f0
/* 374BC 8005C0BC 461E103C */  c.lt.s    $f2, $f30
/* 374C0 8005C0C0 00000000 */  nop
/* 374C4 8005C0C4 450100ED */  bc1t      .L8005C47C
/* 374C8 8005C0C8 00000000 */   nop
/* 374CC 8005C0CC C48A002C */  lwc1      $f10, 0x2C($a0)
/* 374D0 8005C0D0 460E5002 */  mul.s     $f0, $f10, $f14
/* 374D4 8005C0D4 00000000 */  nop
/* 374D8 8005C0D8 C4880028 */  lwc1      $f8, 0x28($a0)
/* 374DC 8005C0DC 460C4102 */  mul.s     $f4, $f8, $f12
/* 374E0 8005C0E0 00000000 */  nop
/* 374E4 8005C0E4 46105282 */  mul.s     $f10, $f10, $f16
/* 374E8 8005C0E8 00000000 */  nop
/* 374EC 8005C0EC 46104202 */  mul.s     $f8, $f8, $f16
/* 374F0 8005C0F0 00000000 */  nop
/* 374F4 8005C0F4 C4A20000 */  lwc1      $f2, 0x0($a1)
/* 374F8 8005C0F8 4602D081 */  sub.s     $f2, $f26, $f2
/* 374FC 8005C0FC 46040001 */  sub.s     $f0, $f0, $f4
/* 37500 8005C100 46001082 */  mul.s     $f2, $f2, $f0
/* 37504 8005C104 00000000 */  nop
/* 37508 8005C108 C4860024 */  lwc1      $f6, 0x24($a0)
/* 3750C 8005C10C 460C3002 */  mul.s     $f0, $f6, $f12
/* 37510 8005C110 00000000 */  nop
/* 37514 8005C114 460E3182 */  mul.s     $f6, $f6, $f14
/* 37518 8005C118 00000000 */  nop
/* 3751C 8005C11C C4A40004 */  lwc1      $f4, 0x4($a1)
/* 37520 8005C120 4604E101 */  sub.s     $f4, $f28, $f4
/* 37524 8005C124 460A0001 */  sub.s     $f0, $f0, $f10
/* 37528 8005C128 46002102 */  mul.s     $f4, $f4, $f0
/* 3752C 8005C12C 00000000 */  nop
/* 37530 8005C130 46064201 */  sub.s     $f8, $f8, $f6
/* 37534 8005C134 C4A00008 */  lwc1      $f0, 0x8($a1)
/* 37538 8005C138 46009001 */  sub.s     $f0, $f18, $f0
/* 3753C 8005C13C 46080002 */  mul.s     $f0, $f0, $f8
/* 37540 8005C140 00000000 */  nop
/* 37544 8005C144 46041080 */  add.s     $f2, $f2, $f4
/* 37548 8005C148 080170D4 */  j         .L8005C350
/* 3754C 8005C14C 46001080 */   add.s    $f2, $f2, $f0
.L8005C150:
/* 37550 8005C150 3C01800A */  lui       $at, %hi(gCollisionRayDirX)
/* 37554 8005C154 C430423C */  lwc1      $f16, %lo(gCollisionRayDirX)($at)
/* 37558 8005C158 46105002 */  mul.s     $f0, $f10, $f16
/* 3755C 8005C15C 00000000 */  nop
/* 37560 8005C160 3C01800A */  lui       $at, %hi(gCollisionRayDirY)
/* 37564 8005C164 C42E4240 */  lwc1      $f14, %lo(gCollisionRayDirY)($at)
/* 37568 8005C168 460E4102 */  mul.s     $f4, $f8, $f14
/* 3756C 8005C16C 00000000 */  nop
/* 37570 8005C170 3C01800A */  lui       $at, %hi(gCollisionRayDirZ)
/* 37574 8005C174 C42C4244 */  lwc1      $f12, %lo(gCollisionRayDirZ)($at)
/* 37578 8005C178 460C3082 */  mul.s     $f2, $f6, $f12
/* 3757C 8005C17C 00000000 */  nop
/* 37580 8005C180 46040000 */  add.s     $f0, $f0, $f4
/* 37584 8005C184 46020000 */  add.s     $f0, $f0, $f2
/* 37588 8005C188 46140002 */  mul.s     $f0, $f0, $f20
/* 3758C 8005C18C 00000000 */  nop
/* 37590 8005C190 4480F000 */  mtc1      $zero, $f30
/* 37594 8005C194 00000000 */  nop
/* 37598 8005C198 4600F03E */  c.le.s    $f30, $f0
/* 3759C 8005C19C 00000000 */  nop
/* 375A0 8005C1A0 450100B6 */  bc1t      .L8005C47C
/* 375A4 8005C1A4 0000102D */   daddu    $v0, $zero, $zero
/* 375A8 8005C1A8 C4880014 */  lwc1      $f8, 0x14($a0)
/* 375AC 8005C1AC 460E4002 */  mul.s     $f0, $f8, $f14
/* 375B0 8005C1B0 00000000 */  nop
/* 375B4 8005C1B4 C4840010 */  lwc1      $f4, 0x10($a0)
/* 375B8 8005C1B8 460C2082 */  mul.s     $f2, $f4, $f12
/* 375BC 8005C1BC 00000000 */  nop
/* 375C0 8005C1C0 46104202 */  mul.s     $f8, $f8, $f16
/* 375C4 8005C1C4 00000000 */  nop
/* 375C8 8005C1C8 46102102 */  mul.s     $f4, $f4, $f16
/* 375CC 8005C1CC 00000000 */  nop
/* 375D0 8005C1D0 46020001 */  sub.s     $f0, $f0, $f2
/* 375D4 8005C1D4 C486000C */  lwc1      $f6, 0xC($a0)
/* 375D8 8005C1D8 460C3082 */  mul.s     $f2, $f6, $f12
/* 375DC 8005C1DC 00000000 */  nop
/* 375E0 8005C1E0 460E3182 */  mul.s     $f6, $f6, $f14
/* 375E4 8005C1E4 00000000 */  nop
/* 375E8 8005C1E8 C7B20008 */  lwc1      $f18, 0x8($sp)
/* 375EC 8005C1EC 46009002 */  mul.s     $f0, $f18, $f0
/* 375F0 8005C1F0 00000000 */  nop
/* 375F4 8005C1F4 46081081 */  sub.s     $f2, $f2, $f8
/* 375F8 8005C1F8 4602C082 */  mul.s     $f2, $f24, $f2
/* 375FC 8005C1FC 00000000 */  nop
/* 37600 8005C200 46062101 */  sub.s     $f4, $f4, $f6
/* 37604 8005C204 4604B102 */  mul.s     $f4, $f22, $f4
/* 37608 8005C208 00000000 */  nop
/* 3760C 8005C20C 46020000 */  add.s     $f0, $f0, $f2
/* 37610 8005C210 46040000 */  add.s     $f0, $f0, $f4
/* 37614 8005C214 46140002 */  mul.s     $f0, $f0, $f20
/* 37618 8005C218 00000000 */  nop
/* 3761C 8005C21C 461E003C */  c.lt.s    $f0, $f30
/* 37620 8005C220 00000000 */  nop
/* 37624 8005C224 45010095 */  bc1t      .L8005C47C
/* 37628 8005C228 00000000 */   nop
/* 3762C 8005C22C C48A0020 */  lwc1      $f10, 0x20($a0)
/* 37630 8005C230 460E5002 */  mul.s     $f0, $f10, $f14
/* 37634 8005C234 00000000 */  nop
/* 37638 8005C238 C488001C */  lwc1      $f8, 0x1C($a0)
/* 3763C 8005C23C 460C4102 */  mul.s     $f4, $f8, $f12
/* 37640 8005C240 00000000 */  nop
/* 37644 8005C244 46105282 */  mul.s     $f10, $f10, $f16
/* 37648 8005C248 00000000 */  nop
/* 3764C 8005C24C 46104202 */  mul.s     $f8, $f8, $f16
/* 37650 8005C250 00000000 */  nop
/* 37654 8005C254 C4620000 */  lwc1      $f2, 0x0($v1)
/* 37658 8005C258 4602D081 */  sub.s     $f2, $f26, $f2
/* 3765C 8005C25C 46040001 */  sub.s     $f0, $f0, $f4
/* 37660 8005C260 46001082 */  mul.s     $f2, $f2, $f0
/* 37664 8005C264 00000000 */  nop
/* 37668 8005C268 C4860018 */  lwc1      $f6, 0x18($a0)
/* 3766C 8005C26C 460C3002 */  mul.s     $f0, $f6, $f12
/* 37670 8005C270 00000000 */  nop
/* 37674 8005C274 460E3182 */  mul.s     $f6, $f6, $f14
/* 37678 8005C278 00000000 */  nop
/* 3767C 8005C27C C4640004 */  lwc1      $f4, 0x4($v1)
/* 37680 8005C280 4604E101 */  sub.s     $f4, $f28, $f4
/* 37684 8005C284 460A0001 */  sub.s     $f0, $f0, $f10
/* 37688 8005C288 46002102 */  mul.s     $f4, $f4, $f0
/* 3768C 8005C28C 00000000 */  nop
/* 37690 8005C290 C7B20000 */  lwc1      $f18, 0x0($sp)
/* 37694 8005C294 46064201 */  sub.s     $f8, $f8, $f6
/* 37698 8005C298 C4600008 */  lwc1      $f0, 0x8($v1)
/* 3769C 8005C29C 46009001 */  sub.s     $f0, $f18, $f0
/* 376A0 8005C2A0 46080002 */  mul.s     $f0, $f0, $f8
/* 376A4 8005C2A4 00000000 */  nop
/* 376A8 8005C2A8 46041080 */  add.s     $f2, $f2, $f4
/* 376AC 8005C2AC 46001080 */  add.s     $f2, $f2, $f0
/* 376B0 8005C2B0 46141082 */  mul.s     $f2, $f2, $f20
/* 376B4 8005C2B4 00000000 */  nop
/* 376B8 8005C2B8 461E103C */  c.lt.s    $f2, $f30
/* 376BC 8005C2BC 00000000 */  nop
/* 376C0 8005C2C0 4501006E */  bc1t      .L8005C47C
/* 376C4 8005C2C4 00000000 */   nop
/* 376C8 8005C2C8 C48A002C */  lwc1      $f10, 0x2C($a0)
/* 376CC 8005C2CC 460E5002 */  mul.s     $f0, $f10, $f14
/* 376D0 8005C2D0 00000000 */  nop
/* 376D4 8005C2D4 C4880028 */  lwc1      $f8, 0x28($a0)
/* 376D8 8005C2D8 460C4102 */  mul.s     $f4, $f8, $f12
/* 376DC 8005C2DC 00000000 */  nop
/* 376E0 8005C2E0 46105282 */  mul.s     $f10, $f10, $f16
/* 376E4 8005C2E4 00000000 */  nop
/* 376E8 8005C2E8 46104202 */  mul.s     $f8, $f8, $f16
/* 376EC 8005C2EC 00000000 */  nop
/* 376F0 8005C2F0 C4A20000 */  lwc1      $f2, 0x0($a1)
/* 376F4 8005C2F4 4602D081 */  sub.s     $f2, $f26, $f2
/* 376F8 8005C2F8 46040001 */  sub.s     $f0, $f0, $f4
/* 376FC 8005C2FC 46001082 */  mul.s     $f2, $f2, $f0
/* 37700 8005C300 00000000 */  nop
/* 37704 8005C304 C4860024 */  lwc1      $f6, 0x24($a0)
/* 37708 8005C308 460C3002 */  mul.s     $f0, $f6, $f12
/* 3770C 8005C30C 00000000 */  nop
/* 37710 8005C310 460E3182 */  mul.s     $f6, $f6, $f14
/* 37714 8005C314 00000000 */  nop
/* 37718 8005C318 C4A40004 */  lwc1      $f4, 0x4($a1)
/* 3771C 8005C31C 4604E101 */  sub.s     $f4, $f28, $f4
/* 37720 8005C320 460A0001 */  sub.s     $f0, $f0, $f10
/* 37724 8005C324 46002102 */  mul.s     $f4, $f4, $f0
/* 37728 8005C328 00000000 */  nop
/* 3772C 8005C32C 46064201 */  sub.s     $f8, $f8, $f6
/* 37730 8005C330 C4A00008 */  lwc1      $f0, 0x8($a1)
/* 37734 8005C334 46009001 */  sub.s     $f0, $f18, $f0
/* 37738 8005C338 46080002 */  mul.s     $f0, $f0, $f8
/* 3773C 8005C33C 00000000 */  nop
/* 37740 8005C340 46041080 */  add.s     $f2, $f2, $f4
/* 37744 8005C344 46001080 */  add.s     $f2, $f2, $f0
/* 37748 8005C348 46141082 */  mul.s     $f2, $f2, $f20
/* 3774C 8005C34C 00000000 */  nop
.L8005C350:
/* 37750 8005C350 461E103C */  c.lt.s    $f2, $f30
/* 37754 8005C354 00000000 */  nop
/* 37758 8005C358 45030048 */  bc1tl     .L8005C47C
/* 3775C 8005C35C 0000102D */   daddu    $v0, $zero, $zero
/* 37760 8005C360 C4860030 */  lwc1      $f6, 0x30($a0)
/* 37764 8005C364 3C01800A */  lui       $at, %hi(gCollisionRayDirX)
/* 37768 8005C368 C420423C */  lwc1      $f0, %lo(gCollisionRayDirX)($at)
/* 3776C 8005C36C 46003182 */  mul.s     $f6, $f6, $f0
/* 37770 8005C370 00000000 */  nop
/* 37774 8005C374 C4820034 */  lwc1      $f2, 0x34($a0)
/* 37778 8005C378 3C01800A */  lui       $at, %hi(gCollisionRayDirY)
/* 3777C 8005C37C C4204240 */  lwc1      $f0, %lo(gCollisionRayDirY)($at)
/* 37780 8005C380 46001082 */  mul.s     $f2, $f2, $f0
/* 37784 8005C384 00000000 */  nop
/* 37788 8005C388 C4840038 */  lwc1      $f4, 0x38($a0)
/* 3778C 8005C38C 3C01800A */  lui       $at, %hi(gCollisionRayDirZ)
/* 37790 8005C390 C4204244 */  lwc1      $f0, %lo(gCollisionRayDirZ)($at)
/* 37794 8005C394 46002102 */  mul.s     $f4, $f4, $f0
/* 37798 8005C398 00000000 */  nop
/* 3779C 8005C39C 3C01800A */  lui       $at, %hi(gCollisionRayLength)
/* 377A0 8005C3A0 C4284254 */  lwc1      $f8, %lo(gCollisionRayLength)($at)
/* 377A4 8005C3A4 46023180 */  add.s     $f6, $f6, $f2
/* 377A8 8005C3A8 44800000 */  mtc1      $zero, $f0
/* 377AC 8005C3AC 00000000 */  nop
/* 377B0 8005C3B0 4608003E */  c.le.s    $f0, $f8
/* 377B4 8005C3B4 00000000 */  nop
/* 377B8 8005C3B8 45000007 */  bc1f      .L8005C3D8
/* 377BC 8005C3BC 46043180 */   add.s    $f6, $f6, $f4
/* 377C0 8005C3C0 4600A007 */  neg.s     $f0, $f20
/* 377C4 8005C3C4 46060003 */  div.s     $f0, $f0, $f6
/* 377C8 8005C3C8 4600403E */  c.le.s    $f8, $f0
/* 377CC 8005C3CC 00000000 */  nop
/* 377D0 8005C3D0 4501002A */  bc1t      .L8005C47C
/* 377D4 8005C3D4 0000102D */   daddu    $v0, $zero, $zero
.L8005C3D8:
/* 377D8 8005C3D8 4600A007 */  neg.s     $f0, $f20
/* 377DC 8005C3DC 3C01800A */  lui       $at, %hi(gCollisionRayDirX)
/* 377E0 8005C3E0 C422423C */  lwc1      $f2, %lo(gCollisionRayDirX)($at)
/* 377E4 8005C3E4 46060003 */  div.s     $f0, $f0, $f6
/* 377E8 8005C3E8 46001082 */  mul.s     $f2, $f2, $f0
/* 377EC 8005C3EC 00000000 */  nop
/* 377F0 8005C3F0 3C01800A */  lui       $at, %hi(gCollisionRayDirY)
/* 377F4 8005C3F4 C42A4240 */  lwc1      $f10, %lo(gCollisionRayDirY)($at)
/* 377F8 8005C3F8 46005282 */  mul.s     $f10, $f10, $f0
/* 377FC 8005C3FC 00000000 */  nop
/* 37800 8005C400 3C01800A */  lui       $at, %hi(gCollisionRayStartX)
/* 37804 8005C404 C42C4230 */  lwc1      $f12, %lo(gCollisionRayStartX)($at)
/* 37808 8005C408 3C01800A */  lui       $at, %hi(gCollisionRayDirZ)
/* 3780C 8005C40C C4284244 */  lwc1      $f8, %lo(gCollisionRayDirZ)($at)
/* 37810 8005C410 C4840030 */  lwc1      $f4, 0x30($a0)
/* 37814 8005C414 C4860038 */  lwc1      $f6, 0x38($a0)
/* 37818 8005C418 46004202 */  mul.s     $f8, $f8, $f0
/* 3781C 8005C41C 00000000 */  nop
/* 37820 8005C420 3C01800A */  lui       $at, %hi(gCollisionRayLength)
/* 37824 8005C424 E4204254 */  swc1      $f0, %lo(gCollisionRayLength)($at)
/* 37828 8005C428 3C01800A */  lui       $at, %hi(gCollisionRayStartY)
/* 3782C 8005C42C C4204234 */  lwc1      $f0, %lo(gCollisionRayStartY)($at)
/* 37830 8005C430 24020001 */  addiu     $v0, $zero, 0x1
/* 37834 8005C434 3C01800A */  lui       $at, %hi(gCollisionNormalX)
/* 37838 8005C438 E4244258 */  swc1      $f4, %lo(gCollisionNormalX)($at)
/* 3783C 8005C43C 46026300 */  add.s     $f12, $f12, $f2
/* 37840 8005C440 C4840034 */  lwc1      $f4, 0x34($a0)
/* 37844 8005C444 3C01800A */  lui       $at, %hi(gCollisionRayStartZ)
/* 37848 8005C448 C4224238 */  lwc1      $f2, %lo(gCollisionRayStartZ)($at)
/* 3784C 8005C44C 460A0000 */  add.s     $f0, $f0, $f10
/* 37850 8005C450 3C01800A */  lui       $at, %hi(gCollisionNormalZ)
/* 37854 8005C454 E4264260 */  swc1      $f6, %lo(gCollisionNormalZ)($at)
/* 37858 8005C458 3C01800A */  lui       $at, %hi(gCollisionNormalY)
/* 3785C 8005C45C E424425C */  swc1      $f4, %lo(gCollisionNormalY)($at)
/* 37860 8005C460 46081080 */  add.s     $f2, $f2, $f8
/* 37864 8005C464 3C01800A */  lui       $at, %hi(gCollisionPointX)
/* 37868 8005C468 E42C4248 */  swc1      $f12, %lo(gCollisionPointX)($at)
/* 3786C 8005C46C 3C01800A */  lui       $at, %hi(gCollisionPointY)
/* 37870 8005C470 E420424C */  swc1      $f0, %lo(gCollisionPointY)($at)
/* 37874 8005C474 3C01800A */  lui       $at, %hi(gCollisionPointZ)
/* 37878 8005C478 E4224250 */  swc1      $f2, %lo(gCollisionPointZ)($at)
.L8005C47C:
/* 3787C 8005C47C D7BE0038 */  ldc1      $f30, 0x38($sp)
/* 37880 8005C480 D7BC0030 */  ldc1      $f28, 0x30($sp)
/* 37884 8005C484 D7BA0028 */  ldc1      $f26, 0x28($sp)
/* 37888 8005C488 D7B80020 */  ldc1      $f24, 0x20($sp)
/* 3788C 8005C48C D7B60018 */  ldc1      $f22, 0x18($sp)
/* 37890 8005C490 D7B40010 */  ldc1      $f20, 0x10($sp)
/* 37894 8005C494 03E00008 */  jr        $ra
/* 37898 8005C498 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

s32 test_ray_triangle_general(ColliderTriangle* triangle, Vec3f* vertices) {
    f32 distToTrianglePlane;
    f32 cosAngle;
    Vec3f* v1;
    Vec3f* v2;
    Vec3f* v3;

    if (triangle->normal.x == 0 &&
        triangle->normal.y == 0 &&
        triangle->normal.z == 0)
        return FALSE;

    v1 = triangle->v1;
    v2 = triangle->v2;
    v3 = triangle->v3;

    distToTrianglePlane = triangle->normal.x * (gCollisionRayStartX - v1->x) +
                          triangle->normal.y * (gCollisionRayStartY - v1->y) +
                          triangle->normal.z * (gCollisionRayStartZ - v1->z);

    if (triangle->oneSided) {
        if (distToTrianglePlane < 0) {
            return FALSE;
        }

        if (triangle->normal.x * gCollisionRayDirX + triangle->normal.y * gCollisionRayDirY + triangle->normal.z * gCollisionRayDirZ >= 0) {
            return FALSE;
        }

        if ((gCollisionRayStartX - v1->x) * (triangle->e13.z * gCollisionRayDirY - triangle->e13.y * gCollisionRayDirZ) +
            (gCollisionRayStartY - v1->y) * (triangle->e13.x * gCollisionRayDirZ - triangle->e13.z * gCollisionRayDirX) +
            (gCollisionRayStartZ - v1->z) * (triangle->e13.y * gCollisionRayDirX - triangle->e13.x * gCollisionRayDirY) < 0)
        {
            return FALSE;
        }

        if ((gCollisionRayStartX - v2->x) * (triangle->e21.z * gCollisionRayDirY - triangle->e21.y * gCollisionRayDirZ) +
            (gCollisionRayStartY - v2->y) * (triangle->e21.x * gCollisionRayDirZ - triangle->e21.z * gCollisionRayDirX) +
            (gCollisionRayStartZ - v2->z) * (triangle->e21.y * gCollisionRayDirX - triangle->e21.x * gCollisionRayDirY) < 0)
        {
            return FALSE;
        }

        if ((gCollisionRayStartX - v3->x) * (triangle->e32.z * gCollisionRayDirY - triangle->e32.y * gCollisionRayDirZ) +
            (gCollisionRayStartY - v3->y) * (triangle->e32.x * gCollisionRayDirZ - triangle->e32.z * gCollisionRayDirX) +
            (gCollisionRayStartZ - v3->z) * (triangle->e32.y * gCollisionRayDirX - triangle->e32.x * gCollisionRayDirY) < 0)
        {
            return FALSE;
        }
    } else {
        if ((triangle->normal.x * gCollisionRayDirX + triangle->normal.y * gCollisionRayDirY + triangle->normal.z * gCollisionRayDirZ) * distToTrianglePlane >= 0) {
            return FALSE;
        }

        if (((gCollisionRayStartX - v1->x) * (triangle->e13.z * gCollisionRayDirY - triangle->e13.y * gCollisionRayDirZ) +
             (gCollisionRayStartY - v1->y) * (triangle->e13.x * gCollisionRayDirZ - triangle->e13.z * gCollisionRayDirX) +
             (gCollisionRayStartZ - v1->z) * (triangle->e13.y * gCollisionRayDirX - triangle->e13.x * gCollisionRayDirY)
            ) * distToTrianglePlane < 0)
        {
            return FALSE;
        }

        if (((gCollisionRayStartX - v2->x) * (triangle->e21.z * gCollisionRayDirY - triangle->e21.y * gCollisionRayDirZ) +
             (gCollisionRayStartY - v2->y) * (triangle->e21.x * gCollisionRayDirZ - triangle->e21.z * gCollisionRayDirX) +
             (gCollisionRayStartZ - v2->z) * (triangle->e21.y * gCollisionRayDirX - triangle->e21.x * gCollisionRayDirY)
            ) * distToTrianglePlane < 0)
        {
            return FALSE;
        }

        if (((gCollisionRayStartX - v3->x) * (triangle->e32.z * gCollisionRayDirY - triangle->e32.y * gCollisionRayDirZ) +
             (gCollisionRayStartY - v3->y) * (triangle->e32.x * gCollisionRayDirZ - triangle->e32.z * gCollisionRayDirX) +
             (gCollisionRayStartZ - v3->z) * (triangle->e32.y * gCollisionRayDirX - triangle->e32.x * gCollisionRayDirY)
            ) * distToTrianglePlane < 0)
        {
            return FALSE;
        }
    }

    cosAngle = triangle->normal.x * gCollisionRayDirX + triangle->normal.y * gCollisionRayDirY + triangle->normal.z * gCollisionRayDirZ;
    if (gCollisionRayLength >= 0 && gCollisionRayLength <= -distToTrianglePlane / cosAngle) {
        return FALSE;
    }

    gCollisionRayLength = -distToTrianglePlane  / cosAngle;

    gCollisionPointX = gCollisionRayStartX + gCollisionRayDirX * gCollisionRayLength;
    gCollisionPointY = gCollisionRayStartY + gCollisionRayDirY * gCollisionRayLength;
    gCollisionPointZ = gCollisionRayStartZ + gCollisionRayDirZ * gCollisionRayLength;

    gCollisionNormalX = triangle->normal.x;
    gCollisionNormalY = triangle->normal.y;
    gCollisionNormalZ = triangle->normal.z;

    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spr_component_update_commands
/* 10020C 802DD11C 27BDFF88 */  addiu     $sp, $sp, -0x78
/* 100210 802DD120 AFB1002C */  sw        $s1, 0x2C($sp)
/* 100214 802DD124 0080882D */  daddu     $s1, $a0, $zero
/* 100218 802DD128 AFBF0040 */  sw        $ra, 0x40($sp)
/* 10021C 802DD12C AFB5003C */  sw        $s5, 0x3C($sp)
/* 100220 802DD130 AFB40038 */  sw        $s4, 0x38($sp)
/* 100224 802DD134 AFB30034 */  sw        $s3, 0x34($sp)
/* 100228 802DD138 AFB20030 */  sw        $s2, 0x30($sp)
/* 10022C 802DD13C AFB00028 */  sw        $s0, 0x28($sp)
/* 100230 802DD140 F7BE0070 */  sdc1      $f30, 0x70($sp)
/* 100234 802DD144 F7BC0068 */  sdc1      $f28, 0x68($sp)
/* 100238 802DD148 F7BA0060 */  sdc1      $f26, 0x60($sp)
/* 10023C 802DD14C F7B80058 */  sdc1      $f24, 0x58($sp)
/* 100240 802DD150 F7B60050 */  sdc1      $f22, 0x50($sp)
/* 100244 802DD154 F7B40048 */  sdc1      $f20, 0x48($sp)
/* 100248 802DD158 8E220000 */  lw        $v0, 0x0($s1)
/* 10024C 802DD15C 10400126 */  beqz      $v0, .L802DD5F8
/* 100250 802DD160 00A0982D */   daddu    $s3, $a1, $zero
/* 100254 802DD164 0000902D */  daddu     $s2, $zero, $zero
/* 100258 802DD168 2414FFFF */  addiu     $s4, $zero, -0x1
/* 10025C 802DD16C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 100260 802DD170 4481A000 */  mtc1      $at, $f20
/* 100264 802DD174 8E300008 */  lw        $s0, 0x8($s1)
/* 100268 802DD178 C620000C */  lwc1      $f0, 0xC($s1)
/* 10026C 802DD17C 3C01802E */  lui       $at, %hi(spr_animUpdateTimeScale)
/* 100270 802DD180 C422F4C0 */  lwc1      $f2, %lo(spr_animUpdateTimeScale)($at)
/* 100274 802DD184 4600A786 */  mov.s     $f30, $f20
/* 100278 802DD188 46020001 */  sub.s     $f0, $f0, $f2
/* 10027C 802DD18C 44801000 */  mtc1      $zero, $f2
/* 100280 802DD190 4600A706 */  mov.s     $f28, $f20
/* 100284 802DD194 4602003E */  c.le.s    $f0, $f2
/* 100288 802DD198 00000000 */  nop
/* 10028C 802DD19C 450000FC */  bc1f      .L802DD590
/* 100290 802DD1A0 E620000C */   swc1     $f0, 0xC($s1)
/* 100294 802DD1A4 46001606 */  mov.s     $f24, $f2
/* 100298 802DD1A8 4600A586 */  mov.s     $f22, $f20
/* 10029C 802DD1AC 0280A82D */  daddu     $s5, $s4, $zero
/* 1002A0 802DD1B0 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 1002A4 802DD1B4 4481D000 */  mtc1      $at, $f26
.L802DD1B8:
/* 1002A8 802DD1B8 96630004 */  lhu       $v1, 0x4($s3)
/* 1002AC 802DD1BC 00031C00 */  sll       $v1, $v1, 16
/* 1002B0 802DD1C0 00031403 */  sra       $v0, $v1, 16
/* 1002B4 802DD1C4 00031FC2 */  srl       $v1, $v1, 31
/* 1002B8 802DD1C8 00431021 */  addu      $v0, $v0, $v1
/* 1002BC 802DD1CC 00021043 */  sra       $v0, $v0, 1
/* 1002C0 802DD1D0 8E630000 */  lw        $v1, 0x0($s3)
/* 1002C4 802DD1D4 00021040 */  sll       $v0, $v0, 1
/* 1002C8 802DD1D8 00621021 */  addu      $v0, $v1, $v0
/* 1002CC 802DD1DC 0202102B */  sltu      $v0, $s0, $v0
/* 1002D0 802DD1E0 14400003 */  bnez      $v0, .L802DD1F0
/* 1002D4 802DD1E4 24024000 */   addiu    $v0, $zero, 0x4000
/* 1002D8 802DD1E8 080B7564 */  j         .L802DD590
/* 1002DC 802DD1EC 0060802D */   daddu    $s0, $v1, $zero
.L802DD1F0:
/* 1002E0 802DD1F0 96040000 */  lhu       $a0, 0x0($s0)
/* 1002E4 802DD1F4 3083F000 */  andi      $v1, $a0, 0xF000
/* 1002E8 802DD1F8 10620089 */  beq       $v1, $v0, .L802DD420
/* 1002EC 802DD1FC 28624001 */   slti     $v0, $v1, 0x4001
/* 1002F0 802DD200 1040000F */  beqz      $v0, .L802DD240
/* 1002F4 802DD204 24021000 */   addiu    $v0, $zero, 0x1000
/* 1002F8 802DD208 10620040 */  beq       $v1, $v0, .L802DD30C
/* 1002FC 802DD20C 28621001 */   slti     $v0, $v1, 0x1001
/* 100300 802DD210 50400005 */  beql      $v0, $zero, .L802DD228
/* 100304 802DD214 24022000 */   addiu    $v0, $zero, 0x2000
/* 100308 802DD218 10600019 */  beqz      $v1, .L802DD280
/* 10030C 802DD21C 30820FFF */   andi     $v0, $a0, 0xFFF
/* 100310 802DD220 080B755D */  j         .L802DD574
/* 100314 802DD224 00000000 */   nop
.L802DD228:
/* 100318 802DD228 1062002C */  beq       $v1, $v0, .L802DD2DC
/* 10031C 802DD22C 24023000 */   addiu    $v0, $zero, 0x3000
/* 100320 802DD230 1062005F */  beq       $v1, $v0, .L802DD3B0
/* 100324 802DD234 3083000F */   andi     $v1, $a0, 0xF
/* 100328 802DD238 080B755D */  j         .L802DD574
/* 10032C 802DD23C 00000000 */   nop
.L802DD240:
/* 100330 802DD240 24026000 */  addiu     $v0, $zero, 0x6000
/* 100334 802DD244 10620039 */  beq       $v1, $v0, .L802DD32C
/* 100338 802DD248 28626001 */   slti     $v0, $v1, 0x6001
/* 10033C 802DD24C 10400005 */  beqz      $v0, .L802DD264
/* 100340 802DD250 24025000 */   addiu    $v0, $zero, 0x5000
/* 100344 802DD254 10620089 */  beq       $v1, $v0, .L802DD47C
/* 100348 802DD258 3083000F */   andi     $v1, $a0, 0xF
/* 10034C 802DD25C 080B755D */  j         .L802DD574
/* 100350 802DD260 00000000 */   nop
.L802DD264:
/* 100354 802DD264 24027000 */  addiu     $v0, $zero, 0x7000
/* 100358 802DD268 106200B3 */  beq       $v1, $v0, .L802DD538
/* 10035C 802DD26C 34028000 */   ori      $v0, $zero, 0x8000
/* 100360 802DD270 10620036 */  beq       $v1, $v0, .L802DD34C
/* 100364 802DD274 24020100 */   addiu    $v0, $zero, 0x100
/* 100368 802DD278 080B755D */  j         .L802DD574
/* 10036C 802DD27C 00000000 */   nop
.L802DD280:
/* 100370 802DD280 44820000 */  mtc1      $v0, $f0
/* 100374 802DD284 00000000 */  nop
/* 100378 802DD288 46800020 */  cvt.s.w   $f0, $f0
/* 10037C 802DD28C E620000C */  swc1      $f0, 0xC($s1)
/* 100380 802DD290 46180032 */  c.eq.s    $f0, $f24
/* 100384 802DD294 00000000 */  nop
/* 100388 802DD298 45000006 */  bc1f      .L802DD2B4
/* 10038C 802DD29C 26100002 */   addiu    $s0, $s0, 0x2
/* 100390 802DD2A0 3C01457F */  lui       $at, (0x457FF000 >> 16)
/* 100394 802DD2A4 3421F000 */  ori       $at, $at, (0x457FF000 & 0xFFFF)
/* 100398 802DD2A8 44810000 */  mtc1      $at, $f0
/* 10039C 802DD2AC 00000000 */  nop
/* 1003A0 802DD2B0 E620000C */  swc1      $f0, 0xC($s1)
.L802DD2B4:
/* 1003A4 802DD2B4 E6380024 */  swc1      $f24, 0x24($s1)
/* 1003A8 802DD2B8 E6380020 */  swc1      $f24, 0x20($s1)
/* 1003AC 802DD2BC E638001C */  swc1      $f24, 0x1C($s1)
/* 1003B0 802DD2C0 AE20003C */  sw        $zero, 0x3C($s1)
/* 1003B4 802DD2C4 AE200038 */  sw        $zero, 0x38($s1)
/* 1003B8 802DD2C8 AE200034 */  sw        $zero, 0x34($s1)
/* 1003BC 802DD2CC E6360048 */  swc1      $f22, 0x48($s1)
/* 1003C0 802DD2D0 E6360044 */  swc1      $f22, 0x44($s1)
/* 1003C4 802DD2D4 080B755F */  j         .L802DD57C
/* 1003C8 802DD2D8 E6360040 */   swc1     $f22, 0x40($s1)
.L802DD2DC:
/* 1003CC 802DD2DC 96040000 */  lhu       $a0, 0x0($s0)
/* 1003D0 802DD2E0 0C0B7437 */  jal       spr_unpack_signed_12bit
/* 1003D4 802DD2E4 00000000 */   nop
/* 1003D8 802DD2E8 8E630000 */  lw        $v1, 0x0($s3)
/* 1003DC 802DD2EC 00021040 */  sll       $v0, $v0, 1
/* 1003E0 802DD2F0 00628021 */  addu      $s0, $v1, $v0
/* 1003E4 802DD2F4 161400A1 */  bne       $s0, $s4, .L802DD57C
/* 1003E8 802DD2F8 0200A02D */   daddu    $s4, $s0, $zero
/* 1003EC 802DD2FC 0060802D */  daddu     $s0, $v1, $zero
/* 1003F0 802DD300 E636000C */  swc1      $f22, 0xC($s1)
/* 1003F4 802DD304 080B755F */  j         .L802DD57C
/* 1003F8 802DD308 0200A02D */   daddu    $s4, $s0, $zero
.L802DD30C:
/* 1003FC 802DD30C 30850FFF */  andi      $a1, $a0, 0xFFF
/* 100400 802DD310 24020FFF */  addiu     $v0, $zero, 0xFFF
/* 100404 802DD314 10A20003 */  beq       $a1, $v0, .L802DD324
/* 100408 802DD318 26100002 */   addiu    $s0, $s0, 0x2
/* 10040C 802DD31C 080B74D1 */  j         .L802DD344
/* 100410 802DD320 AE250014 */   sw       $a1, 0x14($s1)
.L802DD324:
/* 100414 802DD324 080B74D1 */  j         .L802DD344
/* 100418 802DD328 AE350014 */   sw       $s5, 0x14($s1)
.L802DD32C:
/* 10041C 802DD32C 30850FFF */  andi      $a1, $a0, 0xFFF
/* 100420 802DD330 24020FFF */  addiu     $v0, $zero, 0xFFF
/* 100424 802DD334 10A20003 */  beq       $a1, $v0, .L802DD344
/* 100428 802DD338 26100002 */   addiu    $s0, $s0, 0x2
/* 10042C 802DD33C 080B755F */  j         .L802DD57C
/* 100430 802DD340 AE250018 */   sw       $a1, 0x18($s1)
.L802DD344:
/* 100434 802DD344 080B755F */  j         .L802DD57C
/* 100438 802DD348 AE350018 */   sw       $s5, 0x18($s1)
.L802DD34C:
/* 10043C 802DD34C 96050000 */  lhu       $a1, 0x0($s0)
/* 100440 802DD350 30A30F00 */  andi      $v1, $a1, 0xF00
/* 100444 802DD354 10620006 */  beq       $v1, $v0, .L802DD370
/* 100448 802DD358 26100002 */   addiu    $s0, $s0, 0x2
/* 10044C 802DD35C 24020200 */  addiu     $v0, $zero, 0x200
/* 100450 802DD360 10620009 */  beq       $v1, $v0, .L802DD388
/* 100454 802DD364 3C04FF00 */   lui      $a0, (0xFF00FFFF >> 16)
/* 100458 802DD368 080B755F */  j         .L802DD57C
/* 10045C 802DD36C 00000000 */   nop
.L802DD370:
/* 100460 802DD370 8E220004 */  lw        $v0, 0x4($s1)
/* 100464 802DD374 3C03FFFF */  lui       $v1, (0xFFFF0000 >> 16)
/* 100468 802DD378 00431024 */  and       $v0, $v0, $v1
/* 10046C 802DD37C 00451025 */  or        $v0, $v0, $a1
/* 100470 802DD380 080B755F */  j         .L802DD57C
/* 100474 802DD384 AE220004 */   sw       $v0, 0x4($s1)
.L802DD388:
/* 100478 802DD388 3484FFFF */  ori       $a0, $a0, (0xFF00FFFF & 0xFFFF)
/* 10047C 802DD38C 8E230004 */  lw        $v1, 0x4($s1)
/* 100480 802DD390 30A200FF */  andi      $v0, $a1, 0xFF
/* 100484 802DD394 3C01802E */  lui       $at, %hi(SpriteUpdateNotifyValue)
/* 100488 802DD398 AC22FEAC */  sw        $v0, %lo(SpriteUpdateNotifyValue)($at)
/* 10048C 802DD39C 00021400 */  sll       $v0, $v0, 16
/* 100490 802DD3A0 00641824 */  and       $v1, $v1, $a0
/* 100494 802DD3A4 00621825 */  or        $v1, $v1, $v0
/* 100498 802DD3A8 080B755F */  j         .L802DD57C
/* 10049C 802DD3AC AE230004 */   sw       $v1, 0x4($s1)
.L802DD3B0:
/* 1004A0 802DD3B0 28620002 */  slti      $v0, $v1, 0x2
/* 1004A4 802DD3B4 10400071 */  beqz      $v0, .L802DD57C
/* 1004A8 802DD3B8 26100002 */   addiu    $s0, $s0, 0x2
/* 1004AC 802DD3BC 0460006F */  bltz      $v1, .L802DD57C
/* 1004B0 802DD3C0 00000000 */   nop
/* 1004B4 802DD3C4 96040000 */  lhu       $a0, 0x0($s0)
/* 1004B8 802DD3C8 26100002 */  addiu     $s0, $s0, 0x2
/* 1004BC 802DD3CC 0C0B743F */  jal       spr_unpack_signed_16bit
/* 1004C0 802DD3D0 36520001 */   ori      $s2, $s2, 0x1
/* 1004C4 802DD3D4 96040000 */  lhu       $a0, 0x0($s0)
/* 1004C8 802DD3D8 26100002 */  addiu     $s0, $s0, 0x2
/* 1004CC 802DD3DC 44822000 */  mtc1      $v0, $f4
/* 1004D0 802DD3E0 00000000 */  nop
/* 1004D4 802DD3E4 46802120 */  cvt.s.w   $f4, $f4
/* 1004D8 802DD3E8 0C0B743F */  jal       spr_unpack_signed_16bit
/* 1004DC 802DD3EC E7A40010 */   swc1     $f4, 0x10($sp)
/* 1004E0 802DD3F0 96040000 */  lhu       $a0, 0x0($s0)
/* 1004E4 802DD3F4 26100002 */  addiu     $s0, $s0, 0x2
/* 1004E8 802DD3F8 44822000 */  mtc1      $v0, $f4
/* 1004EC 802DD3FC 00000000 */  nop
/* 1004F0 802DD400 46802120 */  cvt.s.w   $f4, $f4
/* 1004F4 802DD404 0C0B743F */  jal       spr_unpack_signed_16bit
/* 1004F8 802DD408 E7A40014 */   swc1     $f4, 0x14($sp)
/* 1004FC 802DD40C 44822000 */  mtc1      $v0, $f4
/* 100500 802DD410 00000000 */  nop
/* 100504 802DD414 46802120 */  cvt.s.w   $f4, $f4
/* 100508 802DD418 080B755F */  j         .L802DD57C
/* 10050C 802DD41C E7A40018 */   swc1     $f4, 0x18($sp)
.L802DD420:
/* 100510 802DD420 96040000 */  lhu       $a0, 0x0($s0)
/* 100514 802DD424 26100002 */  addiu     $s0, $s0, 0x2
/* 100518 802DD428 0C0B7437 */  jal       spr_unpack_signed_12bit
/* 10051C 802DD42C 36520002 */   ori      $s2, $s2, 0x2
/* 100520 802DD430 96040000 */  lhu       $a0, 0x0($s0)
/* 100524 802DD434 26100002 */  addiu     $s0, $s0, 0x2
/* 100528 802DD438 44822000 */  mtc1      $v0, $f4
/* 10052C 802DD43C 00000000 */  nop
/* 100530 802DD440 46802120 */  cvt.s.w   $f4, $f4
/* 100534 802DD444 0C0B743F */  jal       spr_unpack_signed_16bit
/* 100538 802DD448 E7A4001C */   swc1     $f4, 0x1C($sp)
/* 10053C 802DD44C 96040000 */  lhu       $a0, 0x0($s0)
/* 100540 802DD450 26100002 */  addiu     $s0, $s0, 0x2
/* 100544 802DD454 44822000 */  mtc1      $v0, $f4
/* 100548 802DD458 00000000 */  nop
/* 10054C 802DD45C 46802120 */  cvt.s.w   $f4, $f4
/* 100550 802DD460 0C0B743F */  jal       spr_unpack_signed_16bit
/* 100554 802DD464 E7A40020 */   swc1     $f4, 0x20($sp)
/* 100558 802DD468 44822000 */  mtc1      $v0, $f4
/* 10055C 802DD46C 00000000 */  nop
/* 100560 802DD470 46802120 */  cvt.s.w   $f4, $f4
/* 100564 802DD474 080B755F */  j         .L802DD57C
/* 100568 802DD478 E7A40024 */   swc1     $f4, 0x24($sp)
.L802DD47C:
/* 10056C 802DD47C 24020001 */  addiu     $v0, $zero, 0x1
/* 100570 802DD480 10620017 */  beq       $v1, $v0, .L802DD4E0
/* 100574 802DD484 26100002 */   addiu    $s0, $s0, 0x2
/* 100578 802DD488 28620002 */  slti      $v0, $v1, 0x2
/* 10057C 802DD48C 50400005 */  beql      $v0, $zero, .L802DD4A4
/* 100580 802DD490 24020002 */   addiu    $v0, $zero, 0x2
/* 100584 802DD494 10600009 */  beqz      $v1, .L802DD4BC
/* 100588 802DD498 00000000 */   nop
/* 10058C 802DD49C 080B755F */  j         .L802DD57C
/* 100590 802DD4A0 36520004 */   ori      $s2, $s2, 0x4
.L802DD4A4:
/* 100594 802DD4A4 10620015 */  beq       $v1, $v0, .L802DD4FC
/* 100598 802DD4A8 24020003 */   addiu    $v0, $zero, 0x3
/* 10059C 802DD4AC 1062001A */  beq       $v1, $v0, .L802DD518
/* 1005A0 802DD4B0 00000000 */   nop
/* 1005A4 802DD4B4 080B755F */  j         .L802DD57C
/* 1005A8 802DD4B8 36520004 */   ori      $s2, $s2, 0x4
.L802DD4BC:
/* 1005AC 802DD4BC 96020000 */  lhu       $v0, 0x0($s0)
/* 1005B0 802DD4C0 26100002 */  addiu     $s0, $s0, 0x2
/* 1005B4 802DD4C4 44820000 */  mtc1      $v0, $f0
/* 1005B8 802DD4C8 00000000 */  nop
/* 1005BC 802DD4CC 46800020 */  cvt.s.w   $f0, $f0
/* 1005C0 802DD4D0 461A0503 */  div.s     $f20, $f0, $f26
/* 1005C4 802DD4D4 4600A786 */  mov.s     $f30, $f20
/* 1005C8 802DD4D8 080B754C */  j         .L802DD530
/* 1005CC 802DD4DC 4600A706 */   mov.s    $f28, $f20
.L802DD4E0:
/* 1005D0 802DD4E0 96020000 */  lhu       $v0, 0x0($s0)
/* 1005D4 802DD4E4 26100002 */  addiu     $s0, $s0, 0x2
/* 1005D8 802DD4E8 44820000 */  mtc1      $v0, $f0
/* 1005DC 802DD4EC 00000000 */  nop
/* 1005E0 802DD4F0 46800020 */  cvt.s.w   $f0, $f0
/* 1005E4 802DD4F4 080B754C */  j         .L802DD530
/* 1005E8 802DD4F8 461A0703 */   div.s    $f28, $f0, $f26
.L802DD4FC:
/* 1005EC 802DD4FC 96020000 */  lhu       $v0, 0x0($s0)
/* 1005F0 802DD500 26100002 */  addiu     $s0, $s0, 0x2
/* 1005F4 802DD504 44820000 */  mtc1      $v0, $f0
/* 1005F8 802DD508 00000000 */  nop
/* 1005FC 802DD50C 46800020 */  cvt.s.w   $f0, $f0
/* 100600 802DD510 080B754C */  j         .L802DD530
/* 100604 802DD514 461A0783 */   div.s    $f30, $f0, $f26
.L802DD518:
/* 100608 802DD518 96020000 */  lhu       $v0, 0x0($s0)
/* 10060C 802DD51C 26100002 */  addiu     $s0, $s0, 0x2
/* 100610 802DD520 44820000 */  mtc1      $v0, $f0
/* 100614 802DD524 00000000 */  nop
/* 100618 802DD528 46800020 */  cvt.s.w   $f0, $f0
/* 10061C 802DD52C 461A0503 */  div.s     $f20, $f0, $f26
.L802DD530:
/* 100620 802DD530 080B755F */  j         .L802DD57C
/* 100624 802DD534 36520004 */   ori      $s2, $s2, 0x4
.L802DD538:
/* 100628 802DD538 8E220010 */  lw        $v0, 0x10($s1)
/* 10062C 802DD53C 10400005 */  beqz      $v0, .L802DD554
/* 100630 802DD540 2442FFFF */   addiu    $v0, $v0, -0x1
/* 100634 802DD544 14400005 */  bnez      $v0, .L802DD55C
/* 100638 802DD548 AE220010 */   sw       $v0, 0x10($s1)
/* 10063C 802DD54C 080B755F */  j         .L802DD57C
/* 100640 802DD550 26100004 */   addiu    $s0, $s0, 0x4
.L802DD554:
/* 100644 802DD554 96020002 */  lhu       $v0, 0x2($s0)
/* 100648 802DD558 AE220010 */  sw        $v0, 0x10($s1)
.L802DD55C:
/* 10064C 802DD55C 0C0B7437 */  jal       spr_unpack_signed_12bit
/* 100650 802DD560 96040000 */   lhu      $a0, 0x0($s0)
/* 100654 802DD564 8E630000 */  lw        $v1, 0x0($s3)
/* 100658 802DD568 00021040 */  sll       $v0, $v0, 1
/* 10065C 802DD56C 080B755F */  j         .L802DD57C
/* 100660 802DD570 00628021 */   addu     $s0, $v1, $v0
.L802DD574:
/* 100664 802DD574 8E700000 */  lw        $s0, 0x0($s3)
/* 100668 802DD578 E636000C */  swc1      $f22, 0xC($s1)
.L802DD57C:
/* 10066C 802DD57C C620000C */  lwc1      $f0, 0xC($s1)
/* 100670 802DD580 4618003E */  c.le.s    $f0, $f24
/* 100674 802DD584 00000000 */  nop
/* 100678 802DD588 4501FF0B */  bc1t      .L802DD1B8
/* 10067C 802DD58C 00000000 */   nop
.L802DD590:
/* 100680 802DD590 32420001 */  andi      $v0, $s2, 0x1
/* 100684 802DD594 10400007 */  beqz      $v0, .L802DD5B4
/* 100688 802DD598 AE300008 */   sw       $s0, 0x8($s1)
/* 10068C 802DD59C C7A40010 */  lwc1      $f4, 0x10($sp)
/* 100690 802DD5A0 E624001C */  swc1      $f4, 0x1C($s1)
/* 100694 802DD5A4 C7A40014 */  lwc1      $f4, 0x14($sp)
/* 100698 802DD5A8 E6240020 */  swc1      $f4, 0x20($s1)
/* 10069C 802DD5AC C7A40018 */  lwc1      $f4, 0x18($sp)
/* 1006A0 802DD5B0 E6240024 */  swc1      $f4, 0x24($s1)
.L802DD5B4:
/* 1006A4 802DD5B4 32420002 */  andi      $v0, $s2, 0x2
/* 1006A8 802DD5B8 1040000A */  beqz      $v0, .L802DD5E4
/* 1006AC 802DD5BC 32420004 */   andi     $v0, $s2, 0x4
/* 1006B0 802DD5C0 C7A4001C */  lwc1      $f4, 0x1C($sp)
/* 1006B4 802DD5C4 4600210D */  trunc.w.s $f4, $f4
/* 1006B8 802DD5C8 E6240034 */  swc1      $f4, 0x34($s1)
/* 1006BC 802DD5CC C7A40020 */  lwc1      $f4, 0x20($sp)
/* 1006C0 802DD5D0 4600210D */  trunc.w.s $f4, $f4
/* 1006C4 802DD5D4 E6240038 */  swc1      $f4, 0x38($s1)
/* 1006C8 802DD5D8 C7A40024 */  lwc1      $f4, 0x24($sp)
/* 1006CC 802DD5DC 4600210D */  trunc.w.s $f4, $f4
/* 1006D0 802DD5E0 E624003C */  swc1      $f4, 0x3C($s1)
.L802DD5E4:
/* 1006D4 802DD5E4 10400004 */  beqz      $v0, .L802DD5F8
/* 1006D8 802DD5E8 00000000 */   nop
/* 1006DC 802DD5EC E63C0040 */  swc1      $f28, 0x40($s1)
/* 1006E0 802DD5F0 E63E0044 */  swc1      $f30, 0x44($s1)
/* 1006E4 802DD5F4 E6340048 */  swc1      $f20, 0x48($s1)
.L802DD5F8:
/* 1006E8 802DD5F8 8FBF0040 */  lw        $ra, 0x40($sp)
/* 1006EC 802DD5FC 8FB5003C */  lw        $s5, 0x3C($sp)
/* 1006F0 802DD600 8FB40038 */  lw        $s4, 0x38($sp)
/* 1006F4 802DD604 8FB30034 */  lw        $s3, 0x34($sp)
/* 1006F8 802DD608 8FB20030 */  lw        $s2, 0x30($sp)
/* 1006FC 802DD60C 8FB1002C */  lw        $s1, 0x2C($sp)
/* 100700 802DD610 8FB00028 */  lw        $s0, 0x28($sp)
/* 100704 802DD614 D7BE0070 */  ldc1      $f30, 0x70($sp)
/* 100708 802DD618 D7BC0068 */  ldc1      $f28, 0x68($sp)
/* 10070C 802DD61C D7BA0060 */  ldc1      $f26, 0x60($sp)
/* 100710 802DD620 D7B80058 */  ldc1      $f24, 0x58($sp)
/* 100714 802DD624 D7B60050 */  ldc1      $f22, 0x50($sp)
/* 100718 802DD628 D7B40048 */  ldc1      $f20, 0x48($sp)
/* 10071C 802DD62C 03E00008 */  jr        $ra
/* 100720 802DD630 27BD0078 */   addiu    $sp, $sp, 0x78

### DECOMPILED C INSTRUCTIONS:

void spr_component_update_commands(SpriteComponent* comp, SpriteAnimComponent* anim) {
    f32 posX, posY, posZ;
    f32 rotX, rotY, rotZ;
    f32 scaleX, scaleY, scaleZ;
    s32 changedFlags;

    u16* bufPos;
    u16* gotoPos;
    s32 cmdValue;

    if (comp->initialized) {
        scaleZ = 1.0f;
        scaleY = 1.0f;
        scaleX = 1.0f;
        changedFlags = 0;

        bufPos = comp->readPos;
        gotoPos = (u16*) -1;

        comp->waitTime -= spr_animUpdateTimeScale;

        while (comp->waitTime <= 0.0f) {
            // overflow check
            if (bufPos >= &anim->cmdList[anim->cmdListSize / 2]) {
                bufPos = anim->cmdList;
                break;
            }

            switch (*bufPos & 0xF000) {
                // 0VVV
                // Wait
                case 0x0000:
                    comp->waitTime = *bufPos++ & 0xFFF;
                    if (comp->waitTime == 0.0f) {
                        comp->waitTime = 4095.0f;
                    }
                    comp->posOffset.z = 0.0f;
                    comp->posOffset.y = 0.0f;
                    comp->posOffset.x = 0.0f;
                    comp->rotation.z = 0;
                    comp->rotation.y = 0;
                    comp->rotation.x = 0;
                    comp->scale.z = 1.0f;
                    comp->scale.y = 1.0f;
                    comp->scale.x = 1.0f;
                    break;
                // 2VVV
                // Goto -- jump to another position in the list
                case 0x2000:
                    bufPos = &anim->cmdList[spr_unpack_signed_12bit(*bufPos)];
                    if (bufPos == gotoPos) {
                        bufPos = anim->cmdList;
                        comp->waitTime = 1.0f;
                    }
                    gotoPos = bufPos;
                    break;
                // 1VVV
                // SetImage -- FFF is valid value for "no image"
                case 0x1000:
                    cmdValue = *bufPos++ & 0xFFF;
                    if (cmdValue != 0xFFF) {
                        comp->currentRaster = cmdValue;
                    } else {
                        comp->currentRaster = -1;
                    }
                    comp->currentPalette = -1;
                    break;
                // 6VVV
                // SetPalette -- FFF to clear
                case 0x6000:
                    cmdValue = *bufPos++ & 0xFFF;
                    if (cmdValue != 0xFFF) {
                        comp->currentPalette = cmdValue;
                    } else {
                        comp->currentPalette = -1;
                    }
                    break;
                // 8VUU
                // SetProperty
                // 81-XX parent to component XX
                // 82-YY set notify value to YY
                case 0x8000:
                    cmdValue = *bufPos++;
                    switch (cmdValue & 0xF00) {
                        case 0x100: // set parent
                            comp->properties = (comp->properties & 0xFFFF0000) | cmdValue;
                            break;
                        case 0x200: // set notify value
                            SpriteUpdateNotifyValue = cmdValue & 0xFF;
                            comp->properties = (comp->properties & 0xFF00FFFF) | (SpriteUpdateNotifyValue << 0x10);
                            break;
                    }
                    break;
                // 3VVV XXXX YYYY ZZZZ
                // SetPosition -- what does the flag do?
                case 0x3000:
                    switch (*bufPos++ & 0xF) {
                        case 0:
                        case 1:
                            posX = spr_unpack_signed_16bit(*bufPos++);
                            posY = spr_unpack_signed_16bit(*bufPos++);
                            posZ = spr_unpack_signed_16bit(*bufPos++);
                            changedFlags |= 1;
                            break;
                    }
                    break;
                // 4XXX YYYY ZZZZ
                // SetRotation (euler angles)
                case 0x4000:
                    rotX = spr_unpack_signed_12bit(*bufPos++);
                    rotY = spr_unpack_signed_16bit(*bufPos++);
                    rotZ = spr_unpack_signed_16bit(*bufPos++);
                    changedFlags |= 2;
                    break;
                // 5VVV UUUU
                // SetScale (%)
                case 0x5000:
                    switch (*bufPos++ & 0xF) {
                        case 0:
                            scaleZ = *bufPos++ / 100.0f;
                            scaleY = scaleZ;
                            scaleX = scaleZ;
                            break;
                        case 1:
                            scaleX = *bufPos++ / 100.0f;
                            break;
                        case 2:
                            scaleY = *bufPos++ / 100.0f;
                            break;
                        case 3:
                            scaleZ = *bufPos++ / 100.0f;
                            break;
                    }
                    changedFlags |= 4;
                    break;
                // 7VVV UUUU
                // Loop -- VV iterations jumping back to UUUU
                case 0x7000:
                    if (comp->loopCounter != 0) {
                        comp->loopCounter--;
                        if (comp->loopCounter == 0) {
                            bufPos += 2;
                            break;
                        }
                    } else {
                        comp->loopCounter = bufPos[1];
                    }
                    bufPos = &anim->cmdList[spr_unpack_signed_12bit(*bufPos)];
                    break;
                // invalid command
                default:
                    bufPos = anim->cmdList;
                    comp->waitTime = 1.0f;
                    break;
            }
        } // end loop

        comp->readPos = bufPos;
        if (changedFlags & 1) {
            comp->posOffset.x = posX;
            comp->posOffset.y = posY;
            comp->posOffset.z = posZ;
        }
        if (changedFlags & 2) {
            comp->rotation.x = rotX;
            comp->rotation.y = rotY;
            comp->rotation.z = rotZ;
        }
        if (changedFlags & 4) {
            comp->scale.x = scaleX;
            comp->scale.y = scaleY;
            comp->scale.z = scaleZ;
        }
    }
}