### RAW ASSEMBLY INSTRUCTIONS:

glabel update_lerp
/* 57B4 8002A3B4 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 57B8 8002A3B8 F7B60028 */  sdc1      $f22, 0x28($sp)
/* 57BC 8002A3BC 4485B000 */  mtc1      $a1, $f22
/* 57C0 8002A3C0 F7B80030 */  sdc1      $f24, 0x30($sp)
/* 57C4 8002A3C4 4486C000 */  mtc1      $a2, $f24
/* 57C8 8002A3C8 AFB00010 */  sw        $s0, 0x10($sp)
/* 57CC 8002A3CC 8FB00048 */  lw        $s0, 0x48($sp)
/* 57D0 8002A3D0 AFB10014 */  sw        $s1, 0x14($sp)
/* 57D4 8002A3D4 AFBF0018 */  sw        $ra, 0x18($sp)
/* 57D8 8002A3D8 F7B40020 */  sdc1      $f20, 0x20($sp)
/* 57DC 8002A3DC 16000003 */  bnez      $s0, .L8002A3EC
/* 57E0 8002A3E0 00E0882D */   daddu    $s1, $a3, $zero
/* 57E4 8002A3E4 0800AA39 */  j         .L8002A8E4
/* 57E8 8002A3E8 4600C006 */   mov.s    $f0, $f24
.L8002A3EC:
/* 57EC 8002A3EC 2C82000D */  sltiu     $v0, $a0, 0xD
/* 57F0 8002A3F0 1040013B */  beqz      $v0, .L8002A8E0
/* 57F4 8002A3F4 00041080 */   sll      $v0, $a0, 2
/* 57F8 8002A3F8 3C018009 */  lui       $at, %hi(jtbl_80097D90)
/* 57FC 8002A3FC 00220821 */  addu      $at, $at, $v0
/* 5800 8002A400 8C227D90 */  lw        $v0, %lo(jtbl_80097D90)($at)
/* 5804 8002A404 00400008 */  jr        $v0
/* 5808 8002A408 00000000 */   nop
glabel .L8002A40C
/* 580C 8002A40C 4616C001 */  sub.s     $f0, $f24, $f22
/* 5810 8002A410 44911000 */  mtc1      $s1, $f2
/* 5814 8002A414 00000000 */  nop
/* 5818 8002A418 468010A0 */  cvt.s.w   $f2, $f2
/* 581C 8002A41C 46020002 */  mul.s     $f0, $f0, $f2
/* 5820 8002A420 00000000 */  nop
/* 5824 8002A424 44901000 */  mtc1      $s0, $f2
/* 5828 8002A428 00000000 */  nop
/* 582C 8002A42C 468010A0 */  cvt.s.w   $f2, $f2
/* 5830 8002A430 0800A938 */  j         .L8002A4E0
/* 5834 8002A434 46020003 */   div.s    $f0, $f0, $f2
glabel .L8002A438
/* 5838 8002A438 02310018 */  mult      $s1, $s1
/* 583C 8002A43C 00004012 */  mflo      $t0
/* 5840 8002A440 00000000 */  nop
/* 5844 8002A444 0800A92D */  j         .L8002A4B4
/* 5848 8002A448 02100018 */   mult     $s0, $s0
glabel .L8002A44C
/* 584C 8002A44C 02310018 */  mult      $s1, $s1
/* 5850 8002A450 00004012 */  mflo      $t0
/* 5854 8002A454 00000000 */  nop
/* 5858 8002A458 0800A925 */  j         .L8002A494
/* 585C 8002A45C 02100018 */   mult     $s0, $s0
glabel .L8002A460
/* 5860 8002A460 02310018 */  mult      $s1, $s1
/* 5864 8002A464 00004012 */  mflo      $t0
/* 5868 8002A468 00000000 */  nop
/* 586C 8002A46C 00000000 */  nop
/* 5870 8002A470 02100018 */  mult      $s0, $s0
/* 5874 8002A474 00001012 */  mflo      $v0
/* 5878 8002A478 00000000 */  nop
/* 587C 8002A47C 00000000 */  nop
/* 5880 8002A480 01110018 */  mult      $t0, $s1
/* 5884 8002A484 00004012 */  mflo      $t0
/* 5888 8002A488 00000000 */  nop
/* 588C 8002A48C 00000000 */  nop
/* 5890 8002A490 00500018 */  mult      $v0, $s0
.L8002A494:
/* 5894 8002A494 00001012 */  mflo      $v0
/* 5898 8002A498 00000000 */  nop
/* 589C 8002A49C 00000000 */  nop
/* 58A0 8002A4A0 01110018 */  mult      $t0, $s1
/* 58A4 8002A4A4 00004012 */  mflo      $t0
/* 58A8 8002A4A8 00000000 */  nop
/* 58AC 8002A4AC 00000000 */  nop
/* 58B0 8002A4B0 00500018 */  mult      $v0, $s0
.L8002A4B4:
/* 58B4 8002A4B4 4616C081 */  sub.s     $f2, $f24, $f22
/* 58B8 8002A4B8 44880000 */  mtc1      $t0, $f0
/* 58BC 8002A4BC 00000000 */  nop
/* 58C0 8002A4C0 46800020 */  cvt.s.w   $f0, $f0
/* 58C4 8002A4C4 46020002 */  mul.s     $f0, $f0, $f2
/* 58C8 8002A4C8 00000000 */  nop
/* 58CC 8002A4CC 00001012 */  mflo      $v0
/* 58D0 8002A4D0 44821000 */  mtc1      $v0, $f2
/* 58D4 8002A4D4 00000000 */  nop
/* 58D8 8002A4D8 468010A0 */  cvt.s.w   $f2, $f2
/* 58DC 8002A4DC 46020003 */  div.s     $f0, $f0, $f2
.L8002A4E0:
/* 58E0 8002A4E0 0800AA39 */  j         .L8002A8E4
/* 58E4 8002A4E4 4600B000 */   add.s    $f0, $f22, $f0
glabel .L8002A4E8
/* 58E8 8002A4E8 44916000 */  mtc1      $s1, $f12
/* 58EC 8002A4EC 00000000 */  nop
/* 58F0 8002A4F0 46806320 */  cvt.s.w   $f12, $f12
/* 58F4 8002A4F4 4490A000 */  mtc1      $s0, $f20
/* 58F8 8002A4F8 00000000 */  nop
/* 58FC 8002A4FC 4680A520 */  cvt.s.w   $f20, $f20
/* 5900 8002A500 46146303 */  div.s     $f12, $f12, $f20
/* 5904 8002A504 3C018009 */  lui       $at, %hi(D_80097DC8)
/* 5908 8002A508 D4207DC8 */  ldc1      $f0, %lo(D_80097DC8)($at)
/* 590C 8002A50C 46006321 */  cvt.d.s   $f12, $f12
/* 5910 8002A510 46206302 */  mul.d     $f12, $f12, $f0
/* 5914 8002A514 00000000 */  nop
/* 5918 8002A518 3C014010 */  lui       $at, (0x40100000 >> 16)
/* 591C 8002A51C 44810800 */  mtc1      $at, $f1
/* 5920 8002A520 44800000 */  mtc1      $zero, $f0
/* 5924 8002A524 00000000 */  nop
/* 5928 8002A528 46206302 */  mul.d     $f12, $f12, $f0
/* 592C 8002A52C 0800A966 */  j         .L8002A598
/* 5930 8002A530 00000000 */   nop
glabel .L8002A534
/* 5934 8002A534 02310018 */  mult      $s1, $s1
/* 5938 8002A538 4490A000 */  mtc1      $s0, $f20
/* 593C 8002A53C 00000000 */  nop
/* 5940 8002A540 4680A520 */  cvt.s.w   $f20, $f20
/* 5944 8002A544 3C018009 */  lui       $at, %hi(D_80097DD0)
/* 5948 8002A548 D4207DD0 */  ldc1      $f0, %lo(D_80097DD0)($at)
/* 594C 8002A54C 00001812 */  mflo      $v1
/* 5950 8002A550 44836000 */  mtc1      $v1, $f12
/* 5954 8002A554 00000000 */  nop
/* 5958 8002A558 46806320 */  cvt.s.w   $f12, $f12
/* 595C 8002A55C 46146303 */  div.s     $f12, $f12, $f20
/* 5960 8002A560 46006321 */  cvt.d.s   $f12, $f12
/* 5964 8002A564 46206302 */  mul.d     $f12, $f12, $f0
/* 5968 8002A568 00000000 */  nop
/* 596C 8002A56C 3C014010 */  lui       $at, (0x40100000 >> 16)
/* 5970 8002A570 44810800 */  mtc1      $at, $f1
/* 5974 8002A574 44800000 */  mtc1      $zero, $f0
/* 5978 8002A578 00000000 */  nop
/* 597C 8002A57C 46206302 */  mul.d     $f12, $f12, $f0
/* 5980 8002A580 00000000 */  nop
/* 5984 8002A584 3C01402E */  lui       $at, (0x402E0000 >> 16)
/* 5988 8002A588 44810800 */  mtc1      $at, $f1
/* 598C 8002A58C 44800000 */  mtc1      $zero, $f0
/* 5990 8002A590 00000000 */  nop
/* 5994 8002A594 46206303 */  div.d     $f12, $f12, $f0
.L8002A598:
/* 5998 8002A598 0C00A874 */  jal       cos_rad
/* 599C 8002A59C 46206320 */   cvt.s.d  $f12, $f12
/* 59A0 8002A5A0 4614A502 */  mul.s     $f20, $f20, $f20
/* 59A4 8002A5A4 00000000 */  nop
/* 59A8 8002A5A8 4616C081 */  sub.s     $f2, $f24, $f22
/* 59AC 8002A5AC 46001082 */  mul.s     $f2, $f2, $f0
/* 59B0 8002A5B0 00000000 */  nop
/* 59B4 8002A5B4 02111023 */  subu      $v0, $s0, $s1
/* 59B8 8002A5B8 44820000 */  mtc1      $v0, $f0
/* 59BC 8002A5BC 00000000 */  nop
/* 59C0 8002A5C0 46800020 */  cvt.s.w   $f0, $f0
/* 59C4 8002A5C4 46001082 */  mul.s     $f2, $f2, $f0
/* 59C8 8002A5C8 00000000 */  nop
/* 59CC 8002A5CC 46001082 */  mul.s     $f2, $f2, $f0
/* 59D0 8002A5D0 00000000 */  nop
/* 59D4 8002A5D4 46141083 */  div.s     $f2, $f2, $f20
/* 59D8 8002A5D8 0800AA39 */  j         .L8002A8E4
/* 59DC 8002A5DC 4602C001 */   sub.s    $f0, $f24, $f2
glabel .L8002A5E0
/* 59E0 8002A5E0 02113823 */  subu      $a3, $s0, $s1
/* 59E4 8002A5E4 00E70018 */  mult      $a3, $a3
/* 59E8 8002A5E8 4616C101 */  sub.s     $f4, $f24, $f22
/* 59EC 8002A5EC 00001812 */  mflo      $v1
/* 59F0 8002A5F0 44830000 */  mtc1      $v1, $f0
/* 59F4 8002A5F4 00000000 */  nop
/* 59F8 8002A5F8 46800020 */  cvt.s.w   $f0, $f0
/* 59FC 8002A5FC 46040002 */  mul.s     $f0, $f0, $f4
/* 5A00 8002A600 00000000 */  nop
/* 5A04 8002A604 02100018 */  mult      $s0, $s0
/* 5A08 8002A608 00001812 */  mflo      $v1
/* 5A0C 8002A60C 44831000 */  mtc1      $v1, $f2
/* 5A10 8002A610 00000000 */  nop
/* 5A14 8002A614 468010A0 */  cvt.s.w   $f2, $f2
/* 5A18 8002A618 0800A9B3 */  j         .L8002A6CC
/* 5A1C 8002A61C 4604B100 */   add.s    $f4, $f22, $f4
glabel .L8002A620
/* 5A20 8002A620 02113823 */  subu      $a3, $s0, $s1
/* 5A24 8002A624 00E70018 */  mult      $a3, $a3
/* 5A28 8002A628 00001012 */  mflo      $v0
/* 5A2C 8002A62C 00000000 */  nop
/* 5A30 8002A630 00000000 */  nop
/* 5A34 8002A634 00470018 */  mult      $v0, $a3
/* 5A38 8002A638 00004012 */  mflo      $t0
/* 5A3C 8002A63C 00000000 */  nop
/* 5A40 8002A640 0800A9A4 */  j         .L8002A690
/* 5A44 8002A644 02100018 */   mult     $s0, $s0
glabel .L8002A648
/* 5A48 8002A648 02113823 */  subu      $a3, $s0, $s1
/* 5A4C 8002A64C 00E70018 */  mult      $a3, $a3
/* 5A50 8002A650 00001012 */  mflo      $v0
/* 5A54 8002A654 00000000 */  nop
/* 5A58 8002A658 00000000 */  nop
/* 5A5C 8002A65C 00470018 */  mult      $v0, $a3
/* 5A60 8002A660 00004012 */  mflo      $t0
/* 5A64 8002A664 00000000 */  nop
/* 5A68 8002A668 00000000 */  nop
/* 5A6C 8002A66C 02100018 */  mult      $s0, $s0
/* 5A70 8002A670 00001012 */  mflo      $v0
/* 5A74 8002A674 00000000 */  nop
/* 5A78 8002A678 00000000 */  nop
/* 5A7C 8002A67C 01070018 */  mult      $t0, $a3
/* 5A80 8002A680 00004012 */  mflo      $t0
/* 5A84 8002A684 00000000 */  nop
/* 5A88 8002A688 00000000 */  nop
/* 5A8C 8002A68C 00500018 */  mult      $v0, $s0
.L8002A690:
/* 5A90 8002A690 4616C101 */  sub.s     $f4, $f24, $f22
/* 5A94 8002A694 44880000 */  mtc1      $t0, $f0
/* 5A98 8002A698 00000000 */  nop
/* 5A9C 8002A69C 46800020 */  cvt.s.w   $f0, $f0
/* 5AA0 8002A6A0 46040002 */  mul.s     $f0, $f0, $f4
/* 5AA4 8002A6A4 00000000 */  nop
/* 5AA8 8002A6A8 00001012 */  mflo      $v0
/* 5AAC 8002A6AC 00000000 */  nop
/* 5AB0 8002A6B0 00000000 */  nop
/* 5AB4 8002A6B4 00500018 */  mult      $v0, $s0
/* 5AB8 8002A6B8 4604B100 */  add.s     $f4, $f22, $f4
/* 5ABC 8002A6BC 00001012 */  mflo      $v0
/* 5AC0 8002A6C0 44821000 */  mtc1      $v0, $f2
/* 5AC4 8002A6C4 00000000 */  nop
/* 5AC8 8002A6C8 468010A0 */  cvt.s.w   $f2, $f2
.L8002A6CC:
/* 5ACC 8002A6CC 46020003 */  div.s     $f0, $f0, $f2
/* 5AD0 8002A6D0 0800AA39 */  j         .L8002A8E4
/* 5AD4 8002A6D4 46002001 */   sub.s    $f0, $f4, $f0
glabel .L8002A6D8
/* 5AD8 8002A6D8 02310018 */  mult      $s1, $s1
/* 5ADC 8002A6DC 4490A000 */  mtc1      $s0, $f20
/* 5AE0 8002A6E0 00000000 */  nop
/* 5AE4 8002A6E4 4680A520 */  cvt.s.w   $f20, $f20
/* 5AE8 8002A6E8 3C018009 */  lui       $at, %hi(D_80097DD8)
/* 5AEC 8002A6EC D4207DD8 */  ldc1      $f0, %lo(D_80097DD8)($at)
/* 5AF0 8002A6F0 00001812 */  mflo      $v1
/* 5AF4 8002A6F4 44836000 */  mtc1      $v1, $f12
/* 5AF8 8002A6F8 00000000 */  nop
/* 5AFC 8002A6FC 46806320 */  cvt.s.w   $f12, $f12
/* 5B00 8002A700 46146303 */  div.s     $f12, $f12, $f20
/* 5B04 8002A704 46006321 */  cvt.d.s   $f12, $f12
/* 5B08 8002A708 46206302 */  mul.d     $f12, $f12, $f0
/* 5B0C 8002A70C 00000000 */  nop
/* 5B10 8002A710 3C014010 */  lui       $at, (0x40100000 >> 16)
/* 5B14 8002A714 44810800 */  mtc1      $at, $f1
/* 5B18 8002A718 44800000 */  mtc1      $zero, $f0
/* 5B1C 8002A71C 00000000 */  nop
/* 5B20 8002A720 46206302 */  mul.d     $f12, $f12, $f0
/* 5B24 8002A724 00000000 */  nop
/* 5B28 8002A728 3C014044 */  lui       $at, (0x40440000 >> 16)
/* 5B2C 8002A72C 44810800 */  mtc1      $at, $f1
/* 5B30 8002A730 44800000 */  mtc1      $zero, $f0
/* 5B34 8002A734 00000000 */  nop
/* 5B38 8002A738 46206303 */  div.d     $f12, $f12, $f0
/* 5B3C 8002A73C 0C00A874 */  jal       cos_rad
/* 5B40 8002A740 46206320 */   cvt.s.d  $f12, $f12
/* 5B44 8002A744 02111023 */  subu      $v0, $s0, $s1
/* 5B48 8002A748 44821000 */  mtc1      $v0, $f2
/* 5B4C 8002A74C 00000000 */  nop
/* 5B50 8002A750 468010A0 */  cvt.s.w   $f2, $f2
/* 5B54 8002A754 46020002 */  mul.s     $f0, $f0, $f2
/* 5B58 8002A758 00000000 */  nop
/* 5B5C 8002A75C 4614A502 */  mul.s     $f20, $f20, $f20
/* 5B60 8002A760 00000000 */  nop
/* 5B64 8002A764 46020002 */  mul.s     $f0, $f0, $f2
/* 5B68 8002A768 00000000 */  nop
/* 5B6C 8002A76C 44801000 */  mtc1      $zero, $f2
/* 5B70 8002A770 46140103 */  div.s     $f4, $f0, $f20
/* 5B74 8002A774 4602203C */  c.lt.s    $f4, $f2
/* 5B78 8002A778 00000000 */  nop
/* 5B7C 8002A77C 45030001 */  bc1tl     .L8002A784
/* 5B80 8002A780 46002107 */   neg.s    $f4, $f4
.L8002A784:
/* 5B84 8002A784 4616C001 */  sub.s     $f0, $f24, $f22
/* 5B88 8002A788 46040002 */  mul.s     $f0, $f0, $f4
/* 5B8C 8002A78C 00000000 */  nop
/* 5B90 8002A790 0800AA39 */  j         .L8002A8E4
/* 5B94 8002A794 4600C001 */   sub.s    $f0, $f24, $f0
glabel .L8002A798
/* 5B98 8002A798 44916000 */  mtc1      $s1, $f12
/* 5B9C 8002A79C 00000000 */  nop
/* 5BA0 8002A7A0 46806320 */  cvt.s.w   $f12, $f12
/* 5BA4 8002A7A4 3C018009 */  lui       $at, %hi(D_80097DE0)
/* 5BA8 8002A7A8 D4207DE0 */  ldc1      $f0, %lo(D_80097DE0)($at)
/* 5BAC 8002A7AC 46006321 */  cvt.d.s   $f12, $f12
/* 5BB0 8002A7B0 46206302 */  mul.d     $f12, $f12, $f0
/* 5BB4 8002A7B4 00000000 */  nop
/* 5BB8 8002A7B8 44900000 */  mtc1      $s0, $f0
/* 5BBC 8002A7BC 00000000 */  nop
/* 5BC0 8002A7C0 46800020 */  cvt.s.w   $f0, $f0
/* 5BC4 8002A7C4 46000021 */  cvt.d.s   $f0, $f0
/* 5BC8 8002A7C8 46206303 */  div.d     $f12, $f12, $f0
/* 5BCC 8002A7CC 0C00A874 */  jal       cos_rad
/* 5BD0 8002A7D0 46206320 */   cvt.s.d  $f12, $f12
/* 5BD4 8002A7D4 4616C081 */  sub.s     $f2, $f24, $f22
/* 5BD8 8002A7D8 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 5BDC 8002A7DC 44812800 */  mtc1      $at, $f5
/* 5BE0 8002A7E0 44802000 */  mtc1      $zero, $f4
/* 5BE4 8002A7E4 46000021 */  cvt.d.s   $f0, $f0
/* 5BE8 8002A7E8 46202101 */  sub.d     $f4, $f4, $f0
/* 5BEC 8002A7EC 460010A1 */  cvt.d.s   $f2, $f2
/* 5BF0 8002A7F0 46241082 */  mul.d     $f2, $f2, $f4
/* 5BF4 8002A7F4 00000000 */  nop
/* 5BF8 8002A7F8 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 5BFC 8002A7FC 44810800 */  mtc1      $at, $f1
/* 5C00 8002A800 44800000 */  mtc1      $zero, $f0
/* 5C04 8002A804 00000000 */  nop
/* 5C08 8002A808 46201082 */  mul.d     $f2, $f2, $f0
/* 5C0C 8002A80C 00000000 */  nop
/* 5C10 8002A810 4600B021 */  cvt.d.s   $f0, $f22
/* 5C14 8002A814 46220000 */  add.d     $f0, $f0, $f2
/* 5C18 8002A818 0800AA39 */  j         .L8002A8E4
/* 5C1C 8002A81C 46200020 */   cvt.s.d  $f0, $f0
glabel .L8002A820
/* 5C20 8002A820 44916000 */  mtc1      $s1, $f12
/* 5C24 8002A824 00000000 */  nop
/* 5C28 8002A828 46806320 */  cvt.s.w   $f12, $f12
/* 5C2C 8002A82C 3C018009 */  lui       $at, %hi(D_80097DE8)
/* 5C30 8002A830 D4207DE8 */  ldc1      $f0, %lo(D_80097DE8)($at)
/* 5C34 8002A834 46006321 */  cvt.d.s   $f12, $f12
/* 5C38 8002A838 46206302 */  mul.d     $f12, $f12, $f0
/* 5C3C 8002A83C 00000000 */  nop
/* 5C40 8002A840 44900000 */  mtc1      $s0, $f0
/* 5C44 8002A844 00000000 */  nop
/* 5C48 8002A848 46800020 */  cvt.s.w   $f0, $f0
/* 5C4C 8002A84C 46000021 */  cvt.d.s   $f0, $f0
/* 5C50 8002A850 46206303 */  div.d     $f12, $f12, $f0
/* 5C54 8002A854 0C00A85B */  jal       sin_rad
/* 5C58 8002A858 46206320 */   cvt.s.d  $f12, $f12
/* 5C5C 8002A85C 4616C081 */  sub.s     $f2, $f24, $f22
/* 5C60 8002A860 46001082 */  mul.s     $f2, $f2, $f0
/* 5C64 8002A864 00000000 */  nop
/* 5C68 8002A868 0800AA39 */  j         .L8002A8E4
/* 5C6C 8002A86C 4602B000 */   add.s    $f0, $f22, $f2
glabel .L8002A870
/* 5C70 8002A870 44916000 */  mtc1      $s1, $f12
/* 5C74 8002A874 00000000 */  nop
/* 5C78 8002A878 46806320 */  cvt.s.w   $f12, $f12
/* 5C7C 8002A87C 3C018009 */  lui       $at, %hi(D_80097DF0)
/* 5C80 8002A880 D4207DF0 */  ldc1      $f0, %lo(D_80097DF0)($at)
/* 5C84 8002A884 46006321 */  cvt.d.s   $f12, $f12
/* 5C88 8002A888 46206302 */  mul.d     $f12, $f12, $f0
/* 5C8C 8002A88C 00000000 */  nop
/* 5C90 8002A890 44900000 */  mtc1      $s0, $f0
/* 5C94 8002A894 00000000 */  nop
/* 5C98 8002A898 46800020 */  cvt.s.w   $f0, $f0
/* 5C9C 8002A89C 46000021 */  cvt.d.s   $f0, $f0
/* 5CA0 8002A8A0 46206303 */  div.d     $f12, $f12, $f0
/* 5CA4 8002A8A4 0C00A874 */  jal       cos_rad
/* 5CA8 8002A8A8 46206320 */   cvt.s.d  $f12, $f12
/* 5CAC 8002A8AC 4616C101 */  sub.s     $f4, $f24, $f22
/* 5CB0 8002A8B0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 5CB4 8002A8B4 44811800 */  mtc1      $at, $f3
/* 5CB8 8002A8B8 44801000 */  mtc1      $zero, $f2
/* 5CBC 8002A8BC 46000021 */  cvt.d.s   $f0, $f0
/* 5CC0 8002A8C0 46201081 */  sub.d     $f2, $f2, $f0
/* 5CC4 8002A8C4 46002121 */  cvt.d.s   $f4, $f4
/* 5CC8 8002A8C8 46222102 */  mul.d     $f4, $f4, $f2
/* 5CCC 8002A8CC 00000000 */  nop
/* 5CD0 8002A8D0 4600B021 */  cvt.d.s   $f0, $f22
/* 5CD4 8002A8D4 46240000 */  add.d     $f0, $f0, $f4
/* 5CD8 8002A8D8 0800AA39 */  j         .L8002A8E4
/* 5CDC 8002A8DC 46200020 */   cvt.s.d  $f0, $f0
.L8002A8E0:
/* 5CE0 8002A8E0 44800000 */  mtc1      $zero, $f0
.L8002A8E4:
/* 5CE4 8002A8E4 8FBF0018 */  lw        $ra, 0x18($sp)
/* 5CE8 8002A8E8 8FB10014 */  lw        $s1, 0x14($sp)
/* 5CEC 8002A8EC 8FB00010 */  lw        $s0, 0x10($sp)
/* 5CF0 8002A8F0 D7B80030 */  ldc1      $f24, 0x30($sp)
/* 5CF4 8002A8F4 D7B60028 */  ldc1      $f22, 0x28($sp)
/* 5CF8 8002A8F8 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 5CFC 8002A8FC 03E00008 */  jr        $ra
/* 5D00 8002A900 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration) {
    s32 timeLeft;
    f32 absMag;

    if (duration == 0) {
        return end;
    }

    switch (easing) {
        case EASING_LINEAR:
            return start + (end - start) * elapsed / duration;
        case EASING_QUADRATIC_IN:
            return start + SQ(elapsed) * (end - start) / SQ(duration);
        case EASING_CUBIC_IN:
            return start + CUBE(elapsed) * (end - start) / CUBE(duration);
        case EASING_QUARTIC_IN:
            return start + QUART(elapsed) * (end - start) / QUART(duration);
        case EASING_COS_SLOW_OVERSHOOT:
            return end - ((end - start) * cos_rad(((f32)elapsed / duration) * PI_D * 4.0) * (duration - elapsed) *
                    (duration - elapsed)) / SQ((f32)duration);
        case EASING_COS_FAST_OVERSHOOT:
            return end - ((end - start) * cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 15.0) * (duration - elapsed) *
                    (duration - elapsed)) / SQ((f32)duration);
        case EASING_QUADRATIC_OUT:
            timeLeft = duration - elapsed;
            return start + (end - start) - ((SQ(timeLeft) * (end - start))) / SQ(duration);
        case EASING_CUBIC_OUT:
            timeLeft = duration - elapsed;
            return start + (end - start) - ((CUBE(timeLeft) * (end - start))) / CUBE(duration);
        case EASING_QUARTIC_OUT:
            timeLeft = duration - elapsed;
            return start + (end - start) - ((QUART(timeLeft) * (end - start))) / QUART(duration);
        case EASING_COS_BOUNCE:
            absMag = cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 40.0) * (duration - elapsed) *
                    (duration - elapsed) / SQ((f32)duration);
            if (absMag < 0.0f) {
                absMag = -absMag;
            }
            return end - (end - start) * absMag;
        case EASING_COS_IN_OUT:
            return start + (end - start) * (1.0 - cos_rad(((f32)elapsed * PI_D) / (f32)duration)) * 0.5;
        case EASING_SIN_OUT:
            return start + (end - start) * sin_rad(((f32)elapsed * (PI_D / 2)) / (f32)duration);
        case EASING_COS_IN:
            return start + (end - start) * (1.0 - cos_rad(((f32)elapsed * (PI_D / 2)) / (f32)duration));
    }

    return 0.0f;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_entities
/* A5DD0 8010F6D0 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* A5DD4 8010F6D4 AFB10014 */  sw        $s1, 0x14($sp)
/* A5DD8 8010F6D8 0000882D */  daddu     $s1, $zero, $zero
/* A5DDC 8010F6DC AFB3001C */  sw        $s3, 0x1C($sp)
/* A5DE0 8010F6E0 3C130200 */  lui       $s3, (0x2000000 >> 16)
/* A5DE4 8010F6E4 3C038015 */  lui       $v1, %hi(entity_updateCounter)
/* A5DE8 8010F6E8 24631330 */  addiu     $v1, $v1, %lo(entity_updateCounter)
/* A5DEC 8010F6EC AFBF0020 */  sw        $ra, 0x20($sp)
/* A5DF0 8010F6F0 AFB20018 */  sw        $s2, 0x18($sp)
/* A5DF4 8010F6F4 AFB00010 */  sw        $s0, 0x10($sp)
/* A5DF8 8010F6F8 8C620000 */  lw        $v0, 0x0($v1)
/* A5DFC 8010F6FC 3C12800B */  lui       $s2, %hi(gCameras)
/* A5E00 8010F700 26521D80 */  addiu     $s2, $s2, %lo(gCameras)
/* A5E04 8010F704 3C018015 */  lui       $at, %hi(D_801512BC)
/* A5E08 8010F708 AC2012BC */  sw        $zero, %lo(D_801512BC)($at)
/* A5E0C 8010F70C 3C018015 */  lui       $at, %hi(entity_numEntities)
/* A5E10 8010F710 AC2012C0 */  sw        $zero, %lo(entity_numEntities)($at)
/* A5E14 8010F714 24420001 */  addiu     $v0, $v0, 0x1
/* A5E18 8010F718 AC620000 */  sw        $v0, 0x0($v1)
.L8010F71C:
/* A5E1C 8010F71C 0C04417A */  jal       get_entity_by_index
/* A5E20 8010F720 0220202D */   daddu    $a0, $s1, $zero
/* A5E24 8010F724 0040802D */  daddu     $s0, $v0, $zero
/* A5E28 8010F728 520000CD */  beql      $s0, $zero, .L8010FA60
/* A5E2C 8010F72C 26310001 */   addiu    $s1, $s1, 0x1
/* A5E30 8010F730 3C028015 */  lui       $v0, %hi(entity_numEntities)
/* A5E34 8010F734 244212C0 */  addiu     $v0, $v0, %lo(entity_numEntities)
/* A5E38 8010F738 8C430000 */  lw        $v1, 0x0($v0)
/* A5E3C 8010F73C 24630001 */  addiu     $v1, $v1, 0x1
/* A5E40 8010F740 AC430000 */  sw        $v1, 0x0($v0)
/* A5E44 8010F744 8E030000 */  lw        $v1, 0x0($s0)
/* A5E48 8010F748 3C024000 */  lui       $v0, (0x40000000 >> 16)
/* A5E4C 8010F74C 00621024 */  and       $v0, $v1, $v0
/* A5E50 8010F750 544000C3 */  bnel      $v0, $zero, .L8010FA60
/* A5E54 8010F754 26310001 */   addiu    $s1, $s1, 0x1
/* A5E58 8010F758 3C020100 */  lui       $v0, (0x1000000 >> 16)
/* A5E5C 8010F75C 00621024 */  and       $v0, $v1, $v0
/* A5E60 8010F760 1040000D */  beqz      $v0, .L8010F798
/* A5E64 8010F764 3C02FEFF */   lui      $v0, (0xFEFFFFFF >> 16)
/* A5E68 8010F768 3442FFFF */  ori       $v0, $v0, (0xFEFFFFFF & 0xFFFF)
/* A5E6C 8010F76C 00622024 */  and       $a0, $v1, $v0
/* A5E70 8010F770 30628000 */  andi      $v0, $v1, 0x8000
/* A5E74 8010F774 14400003 */  bnez      $v0, .L8010F784
/* A5E78 8010F778 AE040000 */   sw       $a0, 0x0($s0)
/* A5E7C 8010F77C 00931025 */  or        $v0, $a0, $s3
/* A5E80 8010F780 AE020000 */  sw        $v0, 0x0($s0)
.L8010F784:
/* A5E84 8010F784 2405000A */  addiu     $a1, $zero, 0xA
/* A5E88 8010F788 8E040028 */  lw        $a0, 0x28($s0)
/* A5E8C 8010F78C 0C0B0CF8 */  jal       start_script
/* A5E90 8010F790 24060020 */   addiu    $a2, $zero, 0x20
/* A5E94 8010F794 AE020024 */  sw        $v0, 0x24($s0)
.L8010F798:
/* A5E98 8010F798 8E020000 */  lw        $v0, 0x0($s0)
/* A5E9C 8010F79C 00531024 */  and       $v0, $v0, $s3
/* A5EA0 8010F7A0 1040002D */  beqz      $v0, .L8010F858
/* A5EA4 8010F7A4 00000000 */   nop
/* A5EA8 8010F7A8 8E020024 */  lw        $v0, 0x24($s0)
/* A5EAC 8010F7AC 0C0B1059 */  jal       does_script_exist
/* A5EB0 8010F7B0 8C440144 */   lw       $a0, 0x144($v0)
/* A5EB4 8010F7B4 10400024 */  beqz      $v0, .L8010F848
/* A5EB8 8010F7B8 3C03FDFF */   lui      $v1, (0xFDFFFFFF >> 16)
/* A5EBC 8010F7BC 8E020000 */  lw        $v0, 0x0($s0)
/* A5EC0 8010F7C0 30420008 */  andi      $v0, $v0, 0x8
/* A5EC4 8010F7C4 10400005 */  beqz      $v0, .L8010F7DC
/* A5EC8 8010F7C8 00000000 */   nop
/* A5ECC 8010F7CC 0C047A2F */  jal       update_model_animator
/* A5ED0 8010F7D0 86040014 */   lh       $a0, 0x14($s0)
/* A5ED4 8010F7D4 08043DF9 */  j         .L8010F7E4
/* A5ED8 8010F7D8 00000000 */   nop
.L8010F7DC:
/* A5EDC 8010F7DC 0C0483C1 */  jal       exec_entity_model_commandlist
/* A5EE0 8010F7E0 86040014 */   lh       $a0, 0x14($s0)
.L8010F7E4:
/* A5EE4 8010F7E4 8E020000 */  lw        $v0, 0x0($s0)
/* A5EE8 8010F7E8 30422000 */  andi      $v0, $v0, 0x2000
/* A5EEC 8010F7EC 1040000E */  beqz      $v0, .L8010F828
/* A5EF0 8010F7F0 00000000 */   nop
/* A5EF4 8010F7F4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* A5EF8 8010F7F8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* A5EFC 8010F7FC 00031080 */  sll       $v0, $v1, 2
/* A5F00 8010F800 00431021 */  addu      $v0, $v0, $v1
/* A5F04 8010F804 00021080 */  sll       $v0, $v0, 2
/* A5F08 8010F808 00431023 */  subu      $v0, $v0, $v1
/* A5F0C 8010F80C 000218C0 */  sll       $v1, $v0, 3
/* A5F10 8010F810 00431021 */  addu      $v0, $v0, $v1
/* A5F14 8010F814 000210C0 */  sll       $v0, $v0, 3
/* A5F18 8010F818 00521021 */  addu      $v0, $v0, $s2
/* A5F1C 8010F81C C440006C */  lwc1      $f0, 0x6C($v0)
/* A5F20 8010F820 46000007 */  neg.s     $f0, $f0
/* A5F24 8010F824 E6000064 */  swc1      $f0, 0x64($s0)
.L8010F828:
/* A5F28 8010F828 8E020000 */  lw        $v0, 0x0($s0)
/* A5F2C 8010F82C 30420010 */  andi      $v0, $v0, 0x10
/* A5F30 8010F830 5440008B */  bnel      $v0, $zero, .L8010FA60
/* A5F34 8010F834 26310001 */   addiu    $s1, $s1, 0x1
/* A5F38 8010F838 0C04408B */  jal       update_entity_transform_matrix
/* A5F3C 8010F83C 0200202D */   daddu    $a0, $s0, $zero
/* A5F40 8010F840 08043E98 */  j         .L8010FA60
/* A5F44 8010F844 26310001 */   addiu    $s1, $s1, 0x1
.L8010F848:
/* A5F48 8010F848 8E020000 */  lw        $v0, 0x0($s0)
/* A5F4C 8010F84C 3463FFFF */  ori       $v1, $v1, (0xFDFFFFFF & 0xFFFF)
/* A5F50 8010F850 00431024 */  and       $v0, $v0, $v1
/* A5F54 8010F854 AE020000 */  sw        $v0, 0x0($s0)
.L8010F858:
/* A5F58 8010F858 82020007 */  lb        $v0, 0x7($s0)
/* A5F5C 8010F85C 92030007 */  lbu       $v1, 0x7($s0)
/* A5F60 8010F860 14400015 */  bnez      $v0, .L8010F8B8
/* A5F64 8010F864 2463FFFF */   addiu    $v1, $v1, -0x1
/* A5F68 8010F868 0C04422E */  jal       entity_get_collision_flags
/* A5F6C 8010F86C 0200202D */   daddu    $a0, $s0, $zero
/* A5F70 8010F870 A2020006 */  sb        $v0, 0x6($s0)
/* A5F74 8010F874 304200FF */  andi      $v0, $v0, 0xFF
/* A5F78 8010F878 10400026 */  beqz      $v0, .L8010F914
/* A5F7C 8010F87C 00000000 */   nop
/* A5F80 8010F880 8E020038 */  lw        $v0, 0x38($s0)
/* A5F84 8010F884 8C420014 */  lw        $v0, 0x14($v0)
/* A5F88 8010F888 10400022 */  beqz      $v0, .L8010F914
/* A5F8C 8010F88C 00000000 */   nop
/* A5F90 8010F890 0040F809 */  jalr      $v0
/* A5F94 8010F894 0200202D */   daddu    $a0, $s0, $zero
/* A5F98 8010F898 1040001E */  beqz      $v0, .L8010F914
/* A5F9C 8010F89C 2402000A */   addiu    $v0, $zero, 0xA
/* A5FA0 8010F8A0 A2020007 */  sb        $v0, 0x7($s0)
/* A5FA4 8010F8A4 8E020000 */  lw        $v0, 0x0($s0)
/* A5FA8 8010F8A8 3C030001 */  lui       $v1, (0x10000 >> 16)
/* A5FAC 8010F8AC 00431025 */  or        $v0, $v0, $v1
/* A5FB0 8010F8B0 08043E45 */  j         .L8010F914
/* A5FB4 8010F8B4 AE020000 */   sw       $v0, 0x0($s0)
.L8010F8B8:
/* A5FB8 8010F8B8 8E040000 */  lw        $a0, 0x0($s0)
/* A5FBC 8010F8BC 30820040 */  andi      $v0, $a0, 0x40
/* A5FC0 8010F8C0 1040000A */  beqz      $v0, .L8010F8EC
/* A5FC4 8010F8C4 A2030007 */   sb       $v1, 0x7($s0)
/* A5FC8 8010F8C8 00031600 */  sll       $v0, $v1, 24
/* A5FCC 8010F8CC 14400005 */  bnez      $v0, .L8010F8E4
/* A5FD0 8010F8D0 34820020 */   ori      $v0, $a0, 0x20
/* A5FD4 8010F8D4 2402FF9F */  addiu     $v0, $zero, -0x61
/* A5FD8 8010F8D8 00821024 */  and       $v0, $a0, $v0
/* A5FDC 8010F8DC 08043E45 */  j         .L8010F914
/* A5FE0 8010F8E0 AE020000 */   sw       $v0, 0x0($s0)
.L8010F8E4:
/* A5FE4 8010F8E4 08043E45 */  j         .L8010F914
/* A5FE8 8010F8E8 AE020000 */   sw       $v0, 0x0($s0)
.L8010F8EC:
/* A5FEC 8010F8EC 00031600 */  sll       $v0, $v1, 24
/* A5FF0 8010F8F0 14400008 */  bnez      $v0, .L8010F914
/* A5FF4 8010F8F4 3C02FFFE */   lui      $v0, (0xFFFEFFFF >> 16)
/* A5FF8 8010F8F8 3442FFFF */  ori       $v0, $v0, (0xFFFEFFFF & 0xFFFF)
/* A5FFC 8010F8FC 3C03FFFD */  lui       $v1, (0xFFFDFFFF >> 16)
/* A6000 8010F900 3463FFFF */  ori       $v1, $v1, (0xFFFDFFFF & 0xFFFF)
/* A6004 8010F904 00821024 */  and       $v0, $a0, $v0
/* A6008 8010F908 00431024 */  and       $v0, $v0, $v1
/* A600C 8010F90C AE020000 */  sw        $v0, 0x0($s0)
/* A6010 8010F910 A2000006 */  sb        $zero, 0x6($s0)
.L8010F914:
/* A6014 8010F914 8E020000 */  lw        $v0, 0x0($s0)
/* A6018 8010F918 30422000 */  andi      $v0, $v0, 0x2000
/* A601C 8010F91C 1040000E */  beqz      $v0, .L8010F958
/* A6020 8010F920 00000000 */   nop
/* A6024 8010F924 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* A6028 8010F928 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* A602C 8010F92C 00031080 */  sll       $v0, $v1, 2
/* A6030 8010F930 00431021 */  addu      $v0, $v0, $v1
/* A6034 8010F934 00021080 */  sll       $v0, $v0, 2
/* A6038 8010F938 00431023 */  subu      $v0, $v0, $v1
/* A603C 8010F93C 000218C0 */  sll       $v1, $v0, 3
/* A6040 8010F940 00431021 */  addu      $v0, $v0, $v1
/* A6044 8010F944 000210C0 */  sll       $v0, $v0, 3
/* A6048 8010F948 00521021 */  addu      $v0, $v0, $s2
/* A604C 8010F94C C440006C */  lwc1      $f0, 0x6C($v0)
/* A6050 8010F950 46000007 */  neg.s     $f0, $f0
/* A6054 8010F954 E6000064 */  swc1      $f0, 0x64($s0)
.L8010F958:
/* A6058 8010F958 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* A605C 8010F95C 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* A6060 8010F960 80420078 */  lb        $v0, 0x78($v0)
/* A6064 8010F964 14400014 */  bnez      $v0, .L8010F9B8
/* A6068 8010F968 00000000 */   nop
/* A606C 8010F96C 8E02001C */  lw        $v0, 0x1C($s0)
/* A6070 8010F970 10400003 */  beqz      $v0, .L8010F980
/* A6074 8010F974 00000000 */   nop
/* A6078 8010F978 0040F809 */  jalr      $v0
/* A607C 8010F97C 0200202D */   daddu    $a0, $s0, $zero
.L8010F980:
/* A6080 8010F980 8E020018 */  lw        $v0, 0x18($s0)
/* A6084 8010F984 1040000C */  beqz      $v0, .L8010F9B8
/* A6088 8010F988 00000000 */   nop
/* A608C 8010F98C 92020009 */  lbu       $v0, 0x9($s0)
/* A6090 8010F990 10400009 */  beqz      $v0, .L8010F9B8
/* A6094 8010F994 2442FFFF */   addiu    $v0, $v0, -0x1
/* A6098 8010F998 A2020009 */  sb        $v0, 0x9($s0)
/* A609C 8010F99C 304200FF */  andi      $v0, $v0, 0xFF
/* A60A0 8010F9A0 14400005 */  bnez      $v0, .L8010F9B8
/* A60A4 8010F9A4 00000000 */   nop
.L8010F9A8:
/* A60A8 8010F9A8 0C043EF6 */  jal       step_entity_commandlist
/* A60AC 8010F9AC 0200202D */   daddu    $a0, $s0, $zero
/* A60B0 8010F9B0 1440FFFD */  bnez      $v0, .L8010F9A8
/* A60B4 8010F9B4 00000000 */   nop
.L8010F9B8:
/* A60B8 8010F9B8 8E020000 */  lw        $v0, 0x0($s0)
/* A60BC 8010F9BC 30420010 */  andi      $v0, $v0, 0x10
/* A60C0 8010F9C0 14400003 */  bnez      $v0, .L8010F9D0
/* A60C4 8010F9C4 00000000 */   nop
/* A60C8 8010F9C8 0C04408B */  jal       update_entity_transform_matrix
/* A60CC 8010F9CC 0200202D */   daddu    $a0, $s0, $zero
.L8010F9D0:
/* A60D0 8010F9D0 8E020000 */  lw        $v0, 0x0($s0)
/* A60D4 8010F9D4 30420020 */  andi      $v0, $v0, 0x20
/* A60D8 8010F9D8 14400003 */  bnez      $v0, .L8010F9E8
/* A60DC 8010F9DC 00000000 */   nop
/* A60E0 8010F9E0 0C044129 */  jal       update_entity_inverse_rotation_matrix
/* A60E4 8010F9E4 0200202D */   daddu    $a0, $s0, $zero
.L8010F9E8:
/* A60E8 8010F9E8 8E020000 */  lw        $v0, 0x0($s0)
/* A60EC 8010F9EC 30420008 */  andi      $v0, $v0, 0x8
/* A60F0 8010F9F0 10400005 */  beqz      $v0, .L8010FA08
/* A60F4 8010F9F4 00000000 */   nop
/* A60F8 8010F9F8 0C047A2F */  jal       update_model_animator
/* A60FC 8010F9FC 86040014 */   lh       $a0, 0x14($s0)
/* A6100 8010FA00 08043E84 */  j         .L8010FA10
/* A6104 8010FA04 00000000 */   nop
.L8010FA08:
/* A6108 8010FA08 0C0483C1 */  jal       exec_entity_model_commandlist
/* A610C 8010FA0C 86040014 */   lh       $a0, 0x14($s0)
.L8010FA10:
/* A6110 8010FA10 86020016 */  lh        $v0, 0x16($s0)
/* A6114 8010FA14 04400003 */  bltz      $v0, .L8010FA24
/* A6118 8010FA18 00000000 */   nop
/* A611C 8010FA1C 0C0448D1 */  jal       update_entity_shadow_position
/* A6120 8010FA20 0200202D */   daddu    $a0, $s0, $zero
.L8010FA24:
/* A6124 8010FA24 8E020000 */  lw        $v0, 0x0($s0)
/* A6128 8010FA28 3C032000 */  lui       $v1, (0x20000000 >> 16)
/* A612C 8010FA2C 00431024 */  and       $v0, $v0, $v1
/* A6130 8010FA30 10400003 */  beqz      $v0, .L8010FA40
/* A6134 8010FA34 00000000 */   nop
/* A6138 8010FA38 0C0441B4 */  jal       delete_entity
/* A613C 8010FA3C 92040004 */   lbu      $a0, 0x4($s0)
.L8010FA40:
/* A6140 8010FA40 8E020000 */  lw        $v0, 0x0($s0)
/* A6144 8010FA44 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* A6148 8010FA48 00431024 */  and       $v0, $v0, $v1
/* A614C 8010FA4C 10400004 */  beqz      $v0, .L8010FA60
/* A6150 8010FA50 26310001 */   addiu    $s1, $s1, 0x1
/* A6154 8010FA54 92040004 */  lbu       $a0, 0x4($s0)
/* A6158 8010FA58 0C0441E4 */  jal       delete_entity_and_unload_data
/* A615C 8010FA5C 00000000 */   nop
.L8010FA60:
/* A6160 8010FA60 2A22001E */  slti      $v0, $s1, 0x1E
/* A6164 8010FA64 1440FF2D */  bnez      $v0, .L8010F71C
/* A6168 8010FA68 00000000 */   nop
/* A616C 8010FA6C 0C043EA6 */  jal       update_shadows
/* A6170 8010FA70 00000000 */   nop
/* A6174 8010FA74 8FBF0020 */  lw        $ra, 0x20($sp)
/* A6178 8010FA78 8FB3001C */  lw        $s3, 0x1C($sp)
/* A617C 8010FA7C 8FB20018 */  lw        $s2, 0x18($sp)
/* A6180 8010FA80 8FB10014 */  lw        $s1, 0x14($sp)
/* A6184 8010FA84 8FB00010 */  lw        $s0, 0x10($sp)
/* A6188 8010FA88 3C018016 */  lui       $at, %hi(gCurrentHiddenPanels)
/* A618C 8010FA8C A020A578 */  sb        $zero, %lo(gCurrentHiddenPanels)($at)
/* A6190 8010FA90 03E00008 */  jr        $ra
/* A6194 8010FA94 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void update_entities(void) {
    s32 i;

    D_801512BC = 0;
    entity_numEntities = 0;
    entity_updateCounter++;

    for (i = 0; i < MAX_ENTITIES; i++) {
        Entity* entity = get_entity_by_index(i);

        if (entity != NULL) {
            entity_numEntities++;

            if (!(entity->flags & ENTITY_FLAG_SKIP_UPDATE)) {
                if (entity->flags & ENTITY_FLAG_BOUND_SCRIPT_DIRTY) {
                    entity->flags &= ~ENTITY_FLAG_BOUND_SCRIPT_DIRTY;
                    if (!(entity->flags & ENTITY_FLAG_8000)) {
                        entity->flags |= ENTITY_FLAG_2000000;
                    }
                    entity->boundScript = start_script(entity->boundScriptBytecode, EVT_PRIORITY_A, EVT_FLAG_RUN_IMMEDIATELY);
                }

                if (entity->flags & ENTITY_FLAG_2000000) {
                    if (does_script_exist(entity->boundScript->id)) {
                        if (entity->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                            update_model_animator(entity->virtualModelIndex);
                        } else {
                            exec_entity_model_commandlist(entity->virtualModelIndex);
                        }

                        if (entity->flags & ENTITY_FLAG_ALWAYS_FACE_CAMERA) {
                            entity->rotation.y = -gCameras[gCurrentCameraID].currentYaw;
                        }

                        if (!(entity->flags & ENTITY_FLAG_SKIP_UPDATE_TRANSFORM_MATRIX)) {
                            update_entity_transform_matrix(entity);
                        }
                        continue;
                    } else {
                        entity->flags &= ~ENTITY_FLAG_2000000;
                    }
                }

                if (entity->collisionTimer == 0) {
                    entity->collisionFlags = entity_get_collision_flags(entity);

                    if (entity->collisionFlags) {
                        EntityCallback handleCollision = entity->blueprint->fpHandleCollision;

                        if (handleCollision != NULL && handleCollision(entity) != 0) {
                            entity->collisionTimer = 10;
                            entity->flags |= ENTITY_FLAG_DETECTED_COLLISION;
                        }
                    }
                } else {
                    entity->collisionTimer--;
                    if (entity->flags & ENTITY_FLAG_CONTINUOUS_COLLISION) {
                        if (entity->collisionTimer == 0) {
                            entity->flags &= ~(ENTITY_FLAG_DISABLE_COLLISION | ENTITY_FLAG_CONTINUOUS_COLLISION);
                        } else {
                            entity->flags |= ENTITY_FLAG_DISABLE_COLLISION;
                        }
                    } else if (entity->collisionTimer == 0) {
                        entity->flags &= ~ENTITY_FLAG_DETECTED_COLLISION;
                        entity->flags &= ~ENTITY_FLAG_PARTNER_COLLISION;
                        entity->collisionFlags = 0;
                    }
                }

                if (entity->flags & ENTITY_FLAG_ALWAYS_FACE_CAMERA) {
                    entity->rotation.y = -gCameras[gCurrentCameraID].currentYaw;
                }

                if (!gGameStatusPtr->disableScripts) {
                    if (entity->updateScriptCallback != NULL) {
                        entity->updateScriptCallback(entity);
                    }

                    if (entity->scriptReadPos != NULL) {
                        if (entity->scriptDelay != 0) {
                            entity->scriptDelay--;
                            if (entity->scriptDelay == 0) {
                                while (step_entity_commandlist(entity));
                            }
                        }
                    }
                }

                if (!(entity->flags & ENTITY_FLAG_SKIP_UPDATE_TRANSFORM_MATRIX)) {
                    update_entity_transform_matrix(entity);
                }

                if (!(entity->flags & ENTITY_FLAG_DISABLE_COLLISION)) {
                    update_entity_inverse_rotation_matrix(entity);
                }

                if (entity->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL) {
                    update_model_animator(entity->virtualModelIndex);
                } else {
                    exec_entity_model_commandlist(entity->virtualModelIndex);
                }

                if (entity->shadowIndex >= 0) {
                    update_entity_shadow_position(entity);
                }

                if (entity->flags & ENTITY_FLAG_PENDING_INSTANCE_DELETE) {
                    delete_entity(entity->listIndex);
                }

                if (entity->flags & ENTITY_FLAG_PENDING_FULL_DELETE) {
                    delete_entity_and_unload_data(entity->listIndex);
                }
            }
        }
    }

    update_shadows();
    gCurrentHiddenPanels.tryFlipTrigger = FALSE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel player_jump
/* F5E90 802D14E0 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* F5E94 802D14E4 AFB20020 */  sw        $s2, 0x20($sp)
/* F5E98 802D14E8 0080902D */  daddu     $s2, $a0, $zero
/* F5E9C 802D14EC AFB30024 */  sw        $s3, 0x24($sp)
/* F5EA0 802D14F0 AFB1001C */  sw        $s1, 0x1C($sp)
/* F5EA4 802D14F4 3C118011 */  lui       $s1, %hi(gPlayerStatus)
/* F5EA8 802D14F8 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* F5EAC 802D14FC AFBF0028 */  sw        $ra, 0x28($sp)
/* F5EB0 802D1500 AFB00018 */  sw        $s0, 0x18($sp)
/* F5EB4 802D1504 F7B80040 */  sdc1      $f24, 0x40($sp)
/* F5EB8 802D1508 F7B60038 */  sdc1      $f22, 0x38($sp)
/* F5EBC 802D150C F7B40030 */  sdc1      $f20, 0x30($sp)
/* F5EC0 802D1510 8E50000C */  lw        $s0, 0xC($s2)
/* F5EC4 802D1514 10A00002 */  beqz      $a1, .L802D1520
/* F5EC8 802D1518 00C0982D */   daddu    $s3, $a2, $zero
/* F5ECC 802D151C AE400070 */  sw        $zero, 0x70($s2)
.L802D1520:
/* F5ED0 802D1520 8E420070 */  lw        $v0, 0x70($s2)
/* F5ED4 802D1524 1440007E */  bnez      $v0, .L802D1720
/* F5ED8 802D1528 00000000 */   nop
/* F5EDC 802D152C 8E050000 */  lw        $a1, 0x0($s0)
/* F5EE0 802D1530 26100004 */  addiu     $s0, $s0, 0x4
/* F5EE4 802D1534 0C0B1EAF */  jal       evt_get_variable
/* F5EE8 802D1538 0240202D */   daddu    $a0, $s2, $zero
/* F5EEC 802D153C 8E050000 */  lw        $a1, 0x0($s0)
/* F5EF0 802D1540 26100004 */  addiu     $s0, $s0, 0x4
/* F5EF4 802D1544 4482B000 */  mtc1      $v0, $f22
/* F5EF8 802D1548 00000000 */  nop
/* F5EFC 802D154C 4680B5A0 */  cvt.s.w   $f22, $f22
/* F5F00 802D1550 0C0B1EAF */  jal       evt_get_variable
/* F5F04 802D1554 0240202D */   daddu    $a0, $s2, $zero
/* F5F08 802D1558 4482C000 */  mtc1      $v0, $f24
/* F5F0C 802D155C 00000000 */  nop
/* F5F10 802D1560 4680C620 */  cvt.s.w   $f24, $f24
/* F5F14 802D1564 8E050000 */  lw        $a1, 0x0($s0)
/* F5F18 802D1568 26100004 */  addiu     $s0, $s0, 0x4
/* F5F1C 802D156C 0C0B1EAF */  jal       evt_get_variable
/* F5F20 802D1570 0240202D */   daddu    $a0, $s2, $zero
/* F5F24 802D1574 8E050000 */  lw        $a1, 0x0($s0)
/* F5F28 802D1578 4482A000 */  mtc1      $v0, $f20
/* F5F2C 802D157C 00000000 */  nop
/* F5F30 802D1580 4680A520 */  cvt.s.w   $f20, $f20
/* F5F34 802D1584 0C0B1EAF */  jal       evt_get_variable
/* F5F38 802D1588 0240202D */   daddu    $a0, $s2, $zero
/* F5F3C 802D158C 3C10802E */  lui       $s0, %hi(playerNpc)
/* F5F40 802D1590 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F5F44 802D1594 8E030000 */  lw        $v1, 0x0($s0)
/* F5F48 802D1598 C6200028 */  lwc1      $f0, 0x28($s1)
/* F5F4C 802D159C E4600038 */  swc1      $f0, 0x38($v1)
/* F5F50 802D15A0 46000306 */  mov.s     $f12, $f0
/* F5F54 802D15A4 C620002C */  lwc1      $f0, 0x2C($s1)
/* F5F58 802D15A8 E460003C */  swc1      $f0, 0x3C($v1)
/* F5F5C 802D15AC C6200030 */  lwc1      $f0, 0x30($s1)
/* F5F60 802D15B0 E4760060 */  swc1      $f22, 0x60($v1)
/* F5F64 802D15B4 4406B000 */  mfc1      $a2, $f22
/* F5F68 802D15B8 E4740068 */  swc1      $f20, 0x68($v1)
/* F5F6C 802D15BC 4407A000 */  mfc1      $a3, $f20
/* F5F70 802D15C0 E4780064 */  swc1      $f24, 0x64($v1)
/* F5F74 802D15C4 A462008E */  sh        $v0, 0x8E($v1)
/* F5F78 802D15C8 E4600040 */  swc1      $f0, 0x40($v1)
/* F5F7C 802D15CC 46000386 */  mov.s     $f14, $f0
/* F5F80 802D15D0 C6200080 */  lwc1      $f0, 0x80($s1)
/* F5F84 802D15D4 0C00A7B5 */  jal       dist2D
/* F5F88 802D15D8 E460000C */   swc1     $f0, 0xC($v1)
/* F5F8C 802D15DC 46000506 */  mov.s     $f20, $f0
/* F5F90 802D15E0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* F5F94 802D15E4 44811800 */  mtc1      $at, $f3
/* F5F98 802D15E8 44801000 */  mtc1      $zero, $f2
/* F5F9C 802D15EC 4600A021 */  cvt.d.s   $f0, $f20
/* F5FA0 802D15F0 4620103C */  c.lt.d    $f2, $f0
/* F5FA4 802D15F4 00000000 */  nop
/* F5FA8 802D15F8 45000009 */  bc1f      .L802D1620
/* F5FAC 802D15FC 00000000 */   nop
/* F5FB0 802D1600 8E020000 */  lw        $v0, 0x0($s0)
/* F5FB4 802D1604 C44C0038 */  lwc1      $f12, 0x38($v0)
/* F5FB8 802D1608 C44E0040 */  lwc1      $f14, 0x40($v0)
/* F5FBC 802D160C 8C460060 */  lw        $a2, 0x60($v0)
/* F5FC0 802D1610 0C00A720 */  jal       atan2
/* F5FC4 802D1614 8C470068 */   lw       $a3, 0x68($v0)
/* F5FC8 802D1618 8E020000 */  lw        $v0, 0x0($s0)
/* F5FCC 802D161C E440000C */  swc1      $f0, 0xC($v0)
.L802D1620:
/* F5FD0 802D1620 8E030000 */  lw        $v1, 0x0($s0)
/* F5FD4 802D1624 C4620064 */  lwc1      $f2, 0x64($v1)
/* F5FD8 802D1628 C460003C */  lwc1      $f0, 0x3C($v1)
/* F5FDC 802D162C 8462008E */  lh        $v0, 0x8E($v1)
/* F5FE0 802D1630 14400007 */  bnez      $v0, .L802D1650
/* F5FE4 802D1634 46001601 */   sub.s    $f24, $f2, $f0
/* F5FE8 802D1638 C4600018 */  lwc1      $f0, 0x18($v1)
/* F5FEC 802D163C 4600A003 */  div.s     $f0, $f20, $f0
/* F5FF0 802D1640 4600018D */  trunc.w.s $f6, $f0
/* F5FF4 802D1644 44023000 */  mfc1      $v0, $f6
/* F5FF8 802D1648 080B4599 */  j         .L802D1664
/* F5FFC 802D164C A462008E */   sh       $v0, 0x8E($v1)
.L802D1650:
/* F6000 802D1650 44820000 */  mtc1      $v0, $f0
/* F6004 802D1654 00000000 */  nop
/* F6008 802D1658 46800020 */  cvt.s.w   $f0, $f0
/* F600C 802D165C 4600A003 */  div.s     $f0, $f20, $f0
/* F6010 802D1660 E4600018 */  swc1      $f0, 0x18($v1)
.L802D1664:
/* F6014 802D1664 3C03802E */  lui       $v1, %hi(playerNpc)
/* F6018 802D1668 8C639D20 */  lw        $v1, %lo(playerNpc)($v1)
/* F601C 802D166C 8464008E */  lh        $a0, 0x8E($v1)
/* F6020 802D1670 C4620014 */  lwc1      $f2, 0x14($v1)
/* F6024 802D1674 2482FFFF */  addiu     $v0, $a0, -0x1
/* F6028 802D1678 44820000 */  mtc1      $v0, $f0
/* F602C 802D167C 00000000 */  nop
/* F6030 802D1680 46800020 */  cvt.s.w   $f0, $f0
/* F6034 802D1684 46001082 */  mul.s     $f2, $f2, $f0
/* F6038 802D1688 00000000 */  nop
/* F603C 802D168C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* F6040 802D1690 44810000 */  mtc1      $at, $f0
/* F6044 802D1694 00000000 */  nop
/* F6048 802D1698 46001082 */  mul.s     $f2, $f2, $f0
/* F604C 802D169C 00000000 */  nop
/* F6050 802D16A0 44840000 */  mtc1      $a0, $f0
/* F6054 802D16A4 00000000 */  nop
/* F6058 802D16A8 46800020 */  cvt.s.w   $f0, $f0
/* F605C 802D16AC 4600C003 */  div.s     $f0, $f24, $f0
/* F6060 802D16B0 46001080 */  add.s     $f2, $f2, $f0
/* F6064 802D16B4 E462001C */  swc1      $f2, 0x1C($v1)
/* F6068 802D16B8 8E220000 */  lw        $v0, 0x0($s1)
/* F606C 802D16BC 8E230004 */  lw        $v1, 0x4($s1)
/* F6070 802D16C0 34420008 */  ori       $v0, $v0, 0x8
/* F6074 802D16C4 AE220000 */  sw        $v0, 0x0($s1)
/* F6078 802D16C8 3C021000 */  lui       $v0, (0x10000000 >> 16)
/* F607C 802D16CC 00621825 */  or        $v1, $v1, $v0
/* F6080 802D16D0 16600011 */  bnez      $s3, .L802D1718
/* F6084 802D16D4 AE230004 */   sw       $v1, 0x4($s1)
/* F6088 802D16D8 30624000 */  andi      $v0, $v1, 0x4000
/* F608C 802D16DC 14400008 */  bnez      $v0, .L802D1700
/* F6090 802D16E0 3C040009 */   lui      $a0, (0x90005 >> 16)
/* F6094 802D16E4 3C040006 */  lui       $a0, (0x60009 >> 16)
/* F6098 802D16E8 30620001 */  andi      $v0, $v1, 0x1
/* F609C 802D16EC 14400005 */  bnez      $v0, .L802D1704
/* F60A0 802D16F0 34840009 */   ori      $a0, $a0, (0x60009 & 0xFFFF)
/* F60A4 802D16F4 3C040001 */  lui       $a0, (0x10005 >> 16)
/* F60A8 802D16F8 080B45C1 */  j         .L802D1704
/* F60AC 802D16FC 34840007 */   ori      $a0, $a0, (0x10007 & 0xFFFF)
.L802D1700:
/* F60B0 802D1700 34840005 */  ori       $a0, $a0, (0x10005 & 0xFFFF)
.L802D1704:
/* F60B4 802D1704 0C037FBF */  jal       suggest_player_anim_allow_backward
/* F60B8 802D1708 00000000 */   nop
/* F60BC 802D170C 24042081 */  addiu     $a0, $zero, 0x2081
/* F60C0 802D1710 0C052736 */  jal       sfx_play_sound_at_player
/* F60C4 802D1714 0000282D */   daddu    $a1, $zero, $zero
.L802D1718:
/* F60C8 802D1718 24020001 */  addiu     $v0, $zero, 0x1
/* F60CC 802D171C AE420070 */  sw        $v0, 0x70($s2)
.L802D1720:
/* F60D0 802D1720 3C10802E */  lui       $s0, %hi(playerNpc)
/* F60D4 802D1724 26109D20 */  addiu     $s0, $s0, %lo(playerNpc)
/* F60D8 802D1728 8E040000 */  lw        $a0, 0x0($s0)
/* F60DC 802D172C 8C850018 */  lw        $a1, 0x18($a0)
/* F60E0 802D1730 0C00EA95 */  jal       npc_move_heading
/* F60E4 802D1734 8C86000C */   lw       $a2, 0xC($a0)
/* F60E8 802D1738 8E020000 */  lw        $v0, 0x0($s0)
/* F60EC 802D173C C440001C */  lwc1      $f0, 0x1C($v0)
/* F60F0 802D1740 C442003C */  lwc1      $f2, 0x3C($v0)
/* F60F4 802D1744 46000106 */  mov.s     $f4, $f0
/* F60F8 802D1748 46001080 */  add.s     $f2, $f2, $f0
/* F60FC 802D174C C4400014 */  lwc1      $f0, 0x14($v0)
/* F6100 802D1750 46002001 */  sub.s     $f0, $f4, $f0
/* F6104 802D1754 E442003C */  swc1      $f2, 0x3C($v0)
/* F6108 802D1758 16600019 */  bnez      $s3, .L802D17C0
/* F610C 802D175C E440001C */   swc1     $f0, 0x1C($v0)
/* F6110 802D1760 44801000 */  mtc1      $zero, $f2
/* F6114 802D1764 00000000 */  nop
/* F6118 802D1768 4604103C */  c.lt.s    $f2, $f4
/* F611C 802D176C 00000000 */  nop
/* F6120 802D1770 45000013 */  bc1f      .L802D17C0
/* F6124 802D1774 00000000 */   nop
/* F6128 802D1778 4602003E */  c.le.s    $f0, $f2
/* F612C 802D177C 00000000 */  nop
/* F6130 802D1780 4500000F */  bc1f      .L802D17C0
/* F6134 802D1784 00000000 */   nop
/* F6138 802D1788 8E230004 */  lw        $v1, 0x4($s1)
/* F613C 802D178C 30624000 */  andi      $v0, $v1, 0x4000
/* F6140 802D1790 14400008 */  bnez      $v0, .L802D17B4
/* F6144 802D1794 3C040009 */   lui      $a0, (0x90005 >> 16)
/* F6148 802D1798 3C040006 */  lui       $a0, (0x6000A >> 16)
/* F614C 802D179C 30620001 */  andi      $v0, $v1, 0x1
/* F6150 802D17A0 14400005 */  bnez      $v0, .L802D17B8
/* F6154 802D17A4 3484000A */   ori      $a0, $a0, (0x6000A & 0xFFFF)
/* F6158 802D17A8 3C040001 */  lui       $a0, (0x10005 >> 16)
/* F615C 802D17AC 080B45EE */  j         .L802D17B8
/* F6160 802D17B0 34840008 */   ori      $a0, $a0, (0x10008 & 0xFFFF)
.L802D17B4:
/* F6164 802D17B4 34840005 */  ori       $a0, $a0, (0x10005 & 0xFFFF)
.L802D17B8:
/* F6168 802D17B8 0C037FBF */  jal       suggest_player_anim_allow_backward
/* F616C 802D17BC 00000000 */   nop
.L802D17C0:
/* F6170 802D17C0 3C03802E */  lui       $v1, %hi(playerNpc)
/* F6174 802D17C4 24639D20 */  addiu     $v1, $v1, %lo(playerNpc)
/* F6178 802D17C8 8C620000 */  lw        $v0, 0x0($v1)
/* F617C 802D17CC C4400038 */  lwc1      $f0, 0x38($v0)
/* F6180 802D17D0 E6200028 */  swc1      $f0, 0x28($s1)
/* F6184 802D17D4 C440003C */  lwc1      $f0, 0x3C($v0)
/* F6188 802D17D8 E620002C */  swc1      $f0, 0x2C($s1)
/* F618C 802D17DC C4400040 */  lwc1      $f0, 0x40($v0)
/* F6190 802D17E0 16600003 */  bnez      $s3, .L802D17F0
/* F6194 802D17E4 E6200030 */   swc1     $f0, 0x30($s1)
/* F6198 802D17E8 C440000C */  lwc1      $f0, 0xC($v0)
/* F619C 802D17EC E6200080 */  swc1      $f0, 0x80($s1)
.L802D17F0:
/* F61A0 802D17F0 8C630000 */  lw        $v1, 0x0($v1)
/* F61A4 802D17F4 9462008E */  lhu       $v0, 0x8E($v1)
/* F61A8 802D17F8 2442FFFF */  addiu     $v0, $v0, -0x1
/* F61AC 802D17FC A462008E */  sh        $v0, 0x8E($v1)
/* F61B0 802D1800 00021400 */  sll       $v0, $v0, 16
/* F61B4 802D1804 1440002E */  bnez      $v0, .L802D18C0
/* F61B8 802D1808 0000102D */   daddu    $v0, $zero, $zero
/* F61BC 802D180C 3C02EFFF */  lui       $v0, (0xEFFFFFFF >> 16)
/* F61C0 802D1810 3442FFFF */  ori       $v0, $v0, (0xEFFFFFFF & 0xFFFF)
/* F61C4 802D1814 2404FFF7 */  addiu     $a0, $zero, -0x9
/* F61C8 802D1818 8E230000 */  lw        $v1, 0x0($s1)
/* F61CC 802D181C 8E250004 */  lw        $a1, 0x4($s1)
/* F61D0 802D1820 00641824 */  and       $v1, $v1, $a0
/* F61D4 802D1824 00A21024 */  and       $v0, $a1, $v0
/* F61D8 802D1828 AE230000 */  sw        $v1, 0x0($s1)
/* F61DC 802D182C 16600014 */  bnez      $s3, .L802D1880
/* F61E0 802D1830 AE220004 */   sw       $v0, 0x4($s1)
/* F61E4 802D1834 30A24000 */  andi      $v0, $a1, 0x4000
/* F61E8 802D1838 14400008 */  bnez      $v0, .L802D185C
/* F61EC 802D183C 3C040001 */   lui      $a0, (0x10003 >> 16)
/* F61F0 802D1840 3C040006 */  lui       $a0, (0x6000B >> 16)
/* F61F4 802D1844 30A20001 */  andi      $v0, $a1, 0x1
/* F61F8 802D1848 14400005 */  bnez      $v0, .L802D1860
/* F61FC 802D184C 3484000B */   ori      $a0, $a0, (0x6000B & 0xFFFF)
/* F6200 802D1850 3C040001 */  lui       $a0, (0x10003 >> 16)
/* F6204 802D1854 080B4618 */  j         .L802D1860
/* F6208 802D1858 34840009 */   ori      $a0, $a0, (0x10009 & 0xFFFF)
.L802D185C:
/* F620C 802D185C 34840003 */  ori       $a0, $a0, (0x10003 & 0xFFFF)
.L802D1860:
/* F6210 802D1860 0C037FBF */  jal       suggest_player_anim_allow_backward
/* F6214 802D1864 00000000 */   nop
/* F6218 802D1868 3C04802E */  lui       $a0, %hi(playerNpc)
/* F621C 802D186C 8C849D20 */  lw        $a0, %lo(playerNpc)($a0)
/* F6220 802D1870 0C00F598 */  jal       spawn_surface_effects
/* F6224 802D1874 24050002 */   addiu    $a1, $zero, 0x2
/* F6228 802D1878 12600004 */  beqz      $s3, .L802D188C
/* F622C 802D187C 00000000 */   nop
.L802D1880:
/* F6230 802D1880 24020002 */  addiu     $v0, $zero, 0x2
/* F6234 802D1884 1662000E */  bne       $s3, $v0, .L802D18C0
/* F6238 802D1888 24020001 */   addiu    $v0, $zero, 0x1
.L802D188C:
/* F623C 802D188C 3C02802E */  lui       $v0, %hi(playerNpc)
/* F6240 802D1890 8C429D20 */  lw        $v0, %lo(playerNpc)($v0)
/* F6244 802D1894 C44C001C */  lwc1      $f12, 0x1C($v0)
/* F6248 802D1898 0C038D45 */  jal       player_check_collision_below
/* F624C 802D189C 27A50010 */   addiu    $a1, $sp, 0x10
/* F6250 802D18A0 8FA40010 */  lw        $a0, 0x10($sp)
/* F6254 802D18A4 04800005 */  bltz      $a0, .L802D18BC
/* F6258 802D18A8 46000606 */   mov.s    $f24, $f0
/* F625C 802D18AC 0C038C57 */  jal       func_800E315C
/* F6260 802D18B0 E638002C */   swc1     $f24, 0x2C($s1)
/* F6264 802D18B4 0C03BF42 */  jal       func_800EFD08
/* F6268 802D18B8 00000000 */   nop
.L802D18BC:
/* F626C 802D18BC 24020001 */  addiu     $v0, $zero, 0x1
.L802D18C0:
/* F6270 802D18C0 8FBF0028 */  lw        $ra, 0x28($sp)
/* F6274 802D18C4 8FB30024 */  lw        $s3, 0x24($sp)
/* F6278 802D18C8 8FB20020 */  lw        $s2, 0x20($sp)
/* F627C 802D18CC 8FB1001C */  lw        $s1, 0x1C($sp)
/* F6280 802D18D0 8FB00018 */  lw        $s0, 0x18($sp)
/* F6284 802D18D4 D7B80040 */  ldc1      $f24, 0x40($sp)
/* F6288 802D18D8 D7B60038 */  ldc1      $f22, 0x38($sp)
/* F628C 802D18DC D7B40030 */  ldc1      $f20, 0x30($sp)
/* F6290 802D18E0 03E00008 */  jr        $ra
/* F6294 802D18E4 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) {
    Bytecode* args = script->ptrReadPos;
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 xTemp;
    f32 yTemp;
    f32 zTemp;
    f32 jumpVelocity;
    s32 duration;
    AnimID anim;
    f32 dist;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    if (script->functionTemp[0] == 0) {
        xTemp = evt_get_variable(script, *args++);
        yTemp = evt_get_variable(script, *args++);
        zTemp = evt_get_variable(script, *args++);
        duration = evt_get_variable(script, *args++);

        playerNpc->pos.x = playerStatus->position.x;
        playerNpc->pos.y = playerStatus->position.y;
        playerNpc->pos.z = playerStatus->position.z;
        playerNpc->moveToPos.x = xTemp;
        playerNpc->moveToPos.y = yTemp;
        playerNpc->moveToPos.z = zTemp;
        playerNpc->duration = duration;
        playerNpc->yaw = playerStatus->targetYaw;

        dist = dist2D(playerNpc->pos.x, playerNpc->pos.z, playerNpc->moveToPos.x, playerNpc->moveToPos.z);
        if (dist > 1.0) {
            playerNpc->yaw = atan2(playerNpc->pos.x, playerNpc->pos.z, playerNpc->moveToPos.x, playerNpc->moveToPos.z);
        }

        yTemp = playerNpc->moveToPos.y - playerNpc->pos.y;

        if (playerNpc->duration == 0) {
            playerNpc->duration = dist / playerNpc->moveSpeed;
        } else {
            playerNpc->moveSpeed = dist / playerNpc->duration;
        }

        playerNpc->jumpVelocity = (playerNpc->jumpScale * (playerNpc->duration - 1) / 2) + (yTemp / playerNpc->duration);
        playerStatus->flags |= PS_FLAG_FLYING;
        playerStatus->animFlags |= PA_FLAG_NO_OOB_RESPAWN;

        if (mode == 0) {
            if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO)) {
                if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
                    anim = ANIM_Mario1_Jump;
                } else {
                    anim = ANIM_MarioW1_JumpWatt;
                }
            } else {
                anim = ANIM_MarioW3_8bit_Jump;
            }
            suggest_player_anim_allow_backward(anim);
            sfx_play_sound_at_player(SOUND_JUMP_2081, SOUND_SPACE_MODE_0);
        }
        script->functionTemp[0] = 1;
    }

    npc_move_heading(playerNpc, playerNpc->moveSpeed, playerNpc->yaw);
    playerNpc->pos.y += playerNpc->jumpVelocity;
    jumpVelocity = playerNpc->jumpVelocity; // TODO: temp needed and used specifically only once below for this to match
    playerNpc->jumpVelocity -= playerNpc->jumpScale;

    if (mode == 0 && jumpVelocity > 0.0f && playerNpc->jumpVelocity <= 0.0f) {
        if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO)) {
            if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
                anim = ANIM_Mario1_Fall;
            } else {
                anim = ANIM_MarioW1_FallWatt;
            }
        } else {
            anim = ANIM_MarioW3_8bit_Jump;
        }
        suggest_player_anim_allow_backward(anim);
    }

    playerStatus->position.x = playerNpc->pos.x;
    playerStatus->position.y = playerNpc->pos.y;
    playerStatus->position.z = playerNpc->pos.z;

    if (mode == 0) {
        playerStatus->targetYaw = playerNpc->yaw;
    }

    playerNpc->duration--;
    if (playerNpc->duration == 0) {
        playerStatus->flags &= ~PS_FLAG_FLYING;
        playerStatus->animFlags &= ~PA_FLAG_NO_OOB_RESPAWN;

        if (mode == 0) {
            if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO)) {
                if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
                    anim = ANIM_Mario1_Land;
                } else {
                    anim = ANIM_MarioW1_LandWatt;
                }
            } else {
                anim = ANIM_Mario1_TiredIdle;
            }
            suggest_player_anim_allow_backward(anim);
            spawn_surface_effects(playerNpc, SURFACE_INTERACT_LAND);
        }

        if (mode == 0 || mode == 2) {
            s32 colliderID;

            yTemp = player_check_collision_below(playerNpc->jumpVelocity, &colliderID);

            if (colliderID >= 0) {
                playerStatus->position.y = yTemp;
                player_handle_floor_collider_type(colliderID);
                handle_floor_behavior();
            }
        }
        return TRUE;
    }
    return FALSE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel waterfall_appendGfx
/* 3B7440 E00B62E0 27BDFF40 */  addiu     $sp, $sp, -0xC0
/* 3B7444 E00B62E4 0080302D */  daddu     $a2, $a0, $zero
/* 3B7448 E00B62E8 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3B744C E00B62EC 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3B7450 E00B62F0 27A40010 */  addiu     $a0, $sp, 0x10
/* 3B7454 E00B62F4 AFB600A8 */  sw        $s6, 0xA8($sp)
/* 3B7458 E00B62F8 3C160001 */  lui       $s6, (0x11630 >> 16)
/* 3B745C E00B62FC AFB3009C */  sw        $s3, 0x9C($sp)
/* 3B7460 E00B6300 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 3B7464 E00B6304 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 3B7468 E00B6308 36D61630 */  ori       $s6, $s6, (0x11630 & 0xFFFF)
/* 3B746C E00B630C AFBF00B0 */  sw        $ra, 0xB0($sp)
/* 3B7470 E00B6310 AFB700AC */  sw        $s7, 0xAC($sp)
/* 3B7474 E00B6314 AFB500A4 */  sw        $s5, 0xA4($sp)
/* 3B7478 E00B6318 AFB400A0 */  sw        $s4, 0xA0($sp)
/* 3B747C E00B631C AFB20098 */  sw        $s2, 0x98($sp)
/* 3B7480 E00B6320 AFB10094 */  sw        $s1, 0x94($sp)
/* 3B7484 E00B6324 AFB00090 */  sw        $s0, 0x90($sp)
/* 3B7488 E00B6328 F7B400B8 */  sdc1      $f20, 0xB8($sp)
/* 3B748C E00B632C 8E650000 */  lw        $a1, 0x0($s3)
/* 3B7490 E00B6330 8CD2000C */  lw        $s2, 0xC($a2)
/* 3B7494 E00B6334 3C01E00B */  lui       $at, (0xE00B6768 >> 16)
/* 3B7498 E00B6338 D4206768 */  ldc1      $f0, (0xE00B6768 & 0xFFFF)($at)
/* 3B749C E00B633C 00A0182D */  daddu     $v1, $a1, $zero
/* 3B74A0 E00B6340 24A50008 */  addiu     $a1, $a1, 0x8
/* 3B74A4 E00B6344 AE650000 */  sw        $a1, 0x0($s3)
/* 3B74A8 E00B6348 8E570014 */  lw        $s7, 0x14($s2)
/* 3B74AC E00B634C 8E550024 */  lw        $s5, 0x24($s2)
/* 3B74B0 E00B6350 C6540028 */  lwc1      $f20, 0x28($s2)
/* 3B74B4 E00B6354 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3B74B8 E00B6358 AC620000 */  sw        $v0, 0x0($v1)
/* 3B74BC E00B635C AC600004 */  sw        $zero, 0x4($v1)
/* 3B74C0 E00B6360 ACA70000 */  sw        $a3, 0x0($a1)
/* 3B74C4 E00B6364 8CC30010 */  lw        $v1, 0x10($a2)
/* 3B74C8 E00B6368 24A20008 */  addiu     $v0, $a1, 0x8
/* 3B74CC E00B636C AE620000 */  sw        $v0, 0x0($s3)
/* 3B74D0 E00B6370 8C62001C */  lw        $v0, 0x1C($v1)
/* 3B74D4 E00B6374 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3B74D8 E00B6378 4600A521 */  cvt.d.s   $f20, $f20
/* 3B74DC E00B637C 4620A502 */  mul.d     $f20, $f20, $f0
/* 3B74E0 E00B6380 00000000 */  nop
/* 3B74E4 E00B6384 00431021 */  addu      $v0, $v0, $v1
/* 3B74E8 E00B6388 3C03800B */  lui       $v1, %hi(gCameras)
/* 3B74EC E00B638C 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 3B74F0 E00B6390 ACA20004 */  sw        $v0, 0x4($a1)
/* 3B74F4 E00B6394 8E450004 */  lw        $a1, 0x4($s2)
/* 3B74F8 E00B6398 8E460008 */  lw        $a2, 0x8($s2)
/* 3B74FC E00B639C 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 3B7500 E00B63A0 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 3B7504 E00B63A4 8E47000C */  lw        $a3, 0xC($s2)
/* 3B7508 E00B63A8 00028880 */  sll       $s1, $v0, 2
/* 3B750C E00B63AC 02228821 */  addu      $s1, $s1, $v0
/* 3B7510 E00B63B0 00118880 */  sll       $s1, $s1, 2
/* 3B7514 E00B63B4 02228823 */  subu      $s1, $s1, $v0
/* 3B7518 E00B63B8 001110C0 */  sll       $v0, $s1, 3
/* 3B751C E00B63BC 02228821 */  addu      $s1, $s1, $v0
/* 3B7520 E00B63C0 001188C0 */  sll       $s1, $s1, 3
/* 3B7524 E00B63C4 02238821 */  addu      $s1, $s1, $v1
/* 3B7528 E00B63C8 0C080108 */  jal       shim_guTranslateF
/* 3B752C E00B63CC 4620A520 */   cvt.s.d  $f20, $f20
/* 3B7530 E00B63D0 27B00050 */  addiu     $s0, $sp, 0x50
/* 3B7534 E00B63D4 4405A000 */  mfc1      $a1, $f20
/* 3B7538 E00B63D8 0200202D */  daddu     $a0, $s0, $zero
/* 3B753C E00B63DC 00A0302D */  daddu     $a2, $a1, $zero
/* 3B7540 E00B63E0 0C080110 */  jal       shim_guScaleF
/* 3B7544 E00B63E4 00A0382D */   daddu    $a3, $a1, $zero
/* 3B7548 E00B63E8 0200202D */  daddu     $a0, $s0, $zero
/* 3B754C E00B63EC 27A50010 */  addiu     $a1, $sp, 0x10
/* 3B7550 E00B63F0 0C080114 */  jal       shim_guMtxCatF
/* 3B7554 E00B63F4 00A0302D */   daddu    $a2, $a1, $zero
/* 3B7558 E00B63F8 27A40010 */  addiu     $a0, $sp, 0x10
/* 3B755C E00B63FC 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 3B7560 E00B6400 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 3B7564 E00B6404 3C14800A */  lui       $s4, %hi(gDisplayContext)
/* 3B7568 E00B6408 2694A674 */  addiu     $s4, $s4, %lo(gDisplayContext)
/* 3B756C E00B640C 96050000 */  lhu       $a1, 0x0($s0)
/* 3B7570 E00B6410 8E820000 */  lw        $v0, 0x0($s4)
/* 3B7574 E00B6414 00052980 */  sll       $a1, $a1, 6
/* 3B7578 E00B6418 00B62821 */  addu      $a1, $a1, $s6
/* 3B757C E00B641C 0C080118 */  jal       shim_guMtxF2L
/* 3B7580 E00B6420 00452821 */   addu     $a1, $v0, $a1
/* 3B7584 E00B6424 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3B7588 E00B6428 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3B758C E00B642C 3C06DA38 */  lui       $a2, (0xDA380001 >> 16)
/* 3B7590 E00B6430 34C60001 */  ori       $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3B7594 E00B6434 0000482D */  daddu     $t1, $zero, $zero
/* 3B7598 E00B6438 240F0258 */  addiu     $t7, $zero, 0x258
/* 3B759C E00B643C 240C00FF */  addiu     $t4, $zero, 0xFF
/* 3B75A0 E00B6440 240E0400 */  addiu     $t6, $zero, 0x400
/* 3B75A4 E00B6444 240BFFFF */  addiu     $t3, $zero, -0x1
/* 3B75A8 E00B6448 240AFED4 */  addiu     $t2, $zero, -0x12C
/* 3B75AC E00B644C 32B500FF */  andi      $s5, $s5, 0xFF
/* 3B75B0 E00B6450 8E640000 */  lw        $a0, 0x0($s3)
/* 3B75B4 E00B6454 3C014270 */  lui       $at, (0x42700000 >> 16)
/* 3B75B8 E00B6458 44812000 */  mtc1      $at, $f4
/* 3B75BC E00B645C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3B75C0 E00B6460 44811000 */  mtc1      $at, $f2
/* 3B75C4 E00B6464 96020000 */  lhu       $v0, 0x0($s0)
/* 3B75C8 E00B6468 0080282D */  daddu     $a1, $a0, $zero
/* 3B75CC E00B646C 24840008 */  addiu     $a0, $a0, 0x8
/* 3B75D0 E00B6470 248D0020 */  addiu     $t5, $a0, 0x20
/* 3B75D4 E00B6474 01A0402D */  daddu     $t0, $t5, $zero
/* 3B75D8 E00B6478 2487002F */  addiu     $a3, $a0, 0x2F
/* 3B75DC E00B647C AE640000 */  sw        $a0, 0x0($s3)
/* 3B75E0 E00B6480 ACA30000 */  sw        $v1, 0x0($a1)
/* 3B75E4 E00B6484 24430001 */  addiu     $v1, $v0, 0x1
/* 3B75E8 E00B6488 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3B75EC E00B648C 00021180 */  sll       $v0, $v0, 6
/* 3B75F0 E00B6490 A6030000 */  sh        $v1, 0x0($s0)
/* 3B75F4 E00B6494 8E830000 */  lw        $v1, 0x0($s4)
/* 3B75F8 E00B6498 00561021 */  addu      $v0, $v0, $s6
/* 3B75FC E00B649C 00621821 */  addu      $v1, $v1, $v0
/* 3B7600 E00B64A0 24820008 */  addiu     $v0, $a0, 0x8
/* 3B7604 E00B64A4 ACA30004 */  sw        $v1, 0x4($a1)
/* 3B7608 E00B64A8 AE620000 */  sw        $v0, 0x0($s3)
/* 3B760C E00B64AC 24820010 */  addiu     $v0, $a0, 0x10
/* 3B7610 E00B64B0 AC860000 */  sw        $a2, 0x0($a0)
/* 3B7614 E00B64B4 AE620000 */  sw        $v0, 0x0($s3)
/* 3B7618 E00B64B8 8E230204 */  lw        $v1, 0x204($s1)
/* 3B761C E00B64BC 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3B7620 E00B64C0 AC820008 */  sw        $v0, 0x8($a0)
/* 3B7624 E00B64C4 AC830004 */  sw        $v1, 0x4($a0)
/* 3B7628 E00B64C8 9243001B */  lbu       $v1, 0x1B($s2)
/* 3B762C E00B64CC 9245001F */  lbu       $a1, 0x1F($s2)
/* 3B7630 E00B64D0 92460023 */  lbu       $a2, 0x23($s2)
/* 3B7634 E00B64D4 24820018 */  addiu     $v0, $a0, 0x18
/* 3B7638 E00B64D8 AE620000 */  sw        $v0, 0x0($s3)
/* 3B763C E00B64DC 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3B7640 E00B64E0 AC820010 */  sw        $v0, 0x10($a0)
/* 3B7644 E00B64E4 3C020900 */  lui       $v0, %hi(D_09000200_415260)
/* 3B7648 E00B64E8 24420200 */  addiu     $v0, $v0, %lo(D_09000200_415260)
/* 3B764C E00B64EC AC820014 */  sw        $v0, 0x14($a0)
/* 3B7650 E00B64F0 3C02DE01 */  lui       $v0, (0xDE010000 >> 16)
/* 3B7654 E00B64F4 AC820018 */  sw        $v0, 0x18($a0)
/* 3B7658 E00B64F8 248201A0 */  addiu     $v0, $a0, 0x1A0
/* 3B765C E00B64FC AC82001C */  sw        $v0, 0x1C($a0)
/* 3B7660 E00B6500 AE620000 */  sw        $v0, 0x0($s3)
/* 3B7664 E00B6504 00031E00 */  sll       $v1, $v1, 24
/* 3B7668 E00B6508 00052C00 */  sll       $a1, $a1, 16
/* 3B766C E00B650C 00651825 */  or        $v1, $v1, $a1
/* 3B7670 E00B6510 00063200 */  sll       $a2, $a2, 8
/* 3B7674 E00B6514 00661825 */  or        $v1, $v1, $a2
/* 3B7678 E00B6518 00751825 */  or        $v1, $v1, $s5
/* 3B767C E00B651C AC83000C */  sw        $v1, 0xC($a0)
.LE00B6520:
/* 3B7680 E00B6520 A50A0000 */  sh        $t2, 0x0($t0)
/* 3B7684 E00B6524 25080010 */  addiu     $t0, $t0, 0x10
/* 3B7688 E00B6528 00171940 */  sll       $v1, $s7, 5
/* 3B768C E00B652C 26F70004 */  addiu     $s7, $s7, 0x4
/* 3B7690 E00B6530 A4EFFFF3 */  sh        $t7, -0xD($a3)
/* 3B7694 E00B6534 A4E0FFF5 */  sh        $zero, -0xB($a3)
/* 3B7698 E00B6538 A4E3FFF9 */  sh        $v1, -0x7($a3)
/* 3B769C E00B653C C640002C */  lwc1      $f0, 0x2C($s2)
/* 3B76A0 E00B6540 25290001 */  addiu     $t1, $t1, 0x1
/* 3B76A4 E00B6544 A0ECFFFD */  sb        $t4, -0x3($a3)
/* 3B76A8 E00B6548 A0ECFFFE */  sb        $t4, -0x2($a3)
/* 3B76AC E00B654C A0ECFFFF */  sb        $t4, -0x1($a3)
/* 3B76B0 E00B6550 A0EB0000 */  sb        $t3, 0x0($a3)
/* 3B76B4 E00B6554 4600018D */  trunc.w.s $f6, $f0
/* 3B76B8 E00B6558 44023000 */  mfc1      $v0, $f6
/* 3B76BC E00B655C 00000000 */  nop
/* 3B76C0 E00B6560 00021140 */  sll       $v0, $v0, 5
/* 3B76C4 E00B6564 A4E2FFFB */  sh        $v0, -0x5($a3)
/* 3B76C8 E00B6568 24E70010 */  addiu     $a3, $a3, 0x10
/* 3B76CC E00B656C A50A0000 */  sh        $t2, 0x0($t0)
/* 3B76D0 E00B6570 C640002C */  lwc1      $f0, 0x2C($s2)
/* 3B76D4 E00B6574 25080010 */  addiu     $t0, $t0, 0x10
/* 3B76D8 E00B6578 A0EB0000 */  sb        $t3, 0x0($a3)
/* 3B76DC E00B657C 256BFFEC */  addiu     $t3, $t3, -0x14
/* 3B76E0 E00B6580 26520004 */  addiu     $s2, $s2, 0x4
/* 3B76E4 E00B6584 254A0032 */  addiu     $t2, $t2, 0x32
/* 3B76E8 E00B6588 46040000 */  add.s     $f0, $f0, $f4
/* 3B76EC E00B658C A4E0FFF5 */  sh        $zero, -0xB($a3)
/* 3B76F0 E00B6590 A4E3FFF9 */  sh        $v1, -0x7($a3)
/* 3B76F4 E00B6594 46020002 */  mul.s     $f0, $f0, $f2
/* 3B76F8 E00B6598 00000000 */  nop
/* 3B76FC E00B659C A4EEFFFB */  sh        $t6, -0x5($a3)
/* 3B7700 E00B65A0 A0ECFFFD */  sb        $t4, -0x3($a3)
/* 3B7704 E00B65A4 A0ECFFFE */  sb        $t4, -0x2($a3)
/* 3B7708 E00B65A8 A0ECFFFF */  sb        $t4, -0x1($a3)
/* 3B770C E00B65AC 4600018D */  trunc.w.s $f6, $f0
/* 3B7710 E00B65B0 44023000 */  mfc1      $v0, $f6
/* 3B7714 E00B65B4 00000000 */  nop
/* 3B7718 E00B65B8 A4E2FFF3 */  sh        $v0, -0xD($a3)
/* 3B771C E00B65BC 2922000C */  slti      $v0, $t1, 0xC
/* 3B7720 E00B65C0 1440FFD7 */  bnez      $v0, .LE00B6520
/* 3B7724 E00B65C4 24E70010 */   addiu    $a3, $a3, 0x10
/* 3B7728 E00B65C8 0120302D */  daddu     $a2, $t1, $zero
/* 3B772C E00B65CC 3C07800A */  lui       $a3, %hi(gMainGfxPos)
/* 3B7730 E00B65D0 24E7A66C */  addiu     $a3, $a3, %lo(gMainGfxPos)
/* 3B7734 E00B65D4 00061040 */  sll       $v0, $a2, 1
/* 3B7738 E00B65D8 0000482D */  daddu     $t1, $zero, $zero
/* 3B773C E00B65DC 304400FF */  andi      $a0, $v0, 0xFF
/* 3B7740 E00B65E0 00042300 */  sll       $a0, $a0, 12
/* 3B7744 E00B65E4 3042007F */  andi      $v0, $v0, 0x7F
/* 3B7748 E00B65E8 00021040 */  sll       $v0, $v0, 1
/* 3B774C E00B65EC 8CE30000 */  lw        $v1, 0x0($a3)
/* 3B7750 E00B65F0 24C6FFFF */  addiu     $a2, $a2, -0x1
/* 3B7754 E00B65F4 0060282D */  daddu     $a1, $v1, $zero
/* 3B7758 E00B65F8 24630008 */  addiu     $v1, $v1, 0x8
/* 3B775C E00B65FC ACE30000 */  sw        $v1, 0x0($a3)
/* 3B7760 E00B6600 3C030100 */  lui       $v1, (0x1000000 >> 16)
/* 3B7764 E00B6604 00431025 */  or        $v0, $v0, $v1
/* 3B7768 E00B6608 00822025 */  or        $a0, $a0, $v0
/* 3B776C E00B660C ACA40000 */  sw        $a0, 0x0($a1)
/* 3B7770 E00B6610 18C00036 */  blez      $a2, .LE00B66EC
/* 3B7774 E00B6614 ACAD0004 */   sw       $t5, 0x4($a1)
/* 3B7778 E00B6618 00E0682D */  daddu     $t5, $a3, $zero
/* 3B777C E00B661C 3C0C0600 */  lui       $t4, (0x6000000 >> 16)
/* 3B7780 E00B6620 240B0001 */  addiu     $t3, $zero, 0x1
/* 3B7784 E00B6624 3C100606 */  lui       $s0, (0x6060402 >> 16)
/* 3B7788 E00B6628 36100402 */  ori       $s0, $s0, (0x6060402 & 0xFFFF)
/* 3B778C E00B662C 3C0F0002 */  lui       $t7, (0x20406 >> 16)
/* 3B7790 E00B6630 35EF0406 */  ori       $t7, $t7, (0x20406 & 0xFFFF)
/* 3B7794 E00B6634 3C0E0006 */  lui       $t6, (0x60804 >> 16)
/* 3B7798 E00B6638 35CE0804 */  ori       $t6, $t6, (0x60804 & 0xFFFF)
/* 3B779C E00B663C 24080004 */  addiu     $t0, $zero, 0x4
/* 3B77A0 E00B6640 24070002 */  addiu     $a3, $zero, 0x2
/* 3B77A4 E00B6644 240A0006 */  addiu     $t2, $zero, 0x6
.LE00B6648:
/* 3B77A8 E00B6648 8DA40000 */  lw        $a0, 0x0($t5)
/* 3B77AC E00B664C 00092840 */  sll       $a1, $t1, 1
/* 3B77B0 E00B6650 24820008 */  addiu     $v0, $a0, 0x8
/* 3B77B4 E00B6654 14A00004 */  bnez      $a1, .LE00B6668
/* 3B77B8 E00B6658 ADA20000 */   sw       $v0, 0x0($t5)
/* 3B77BC E00B665C 00091440 */  sll       $v0, $t1, 17
/* 3B77C0 E00B6660 0802D9A4 */  j         .LE00B6690
/* 3B77C4 E00B6664 34420402 */   ori      $v0, $v0, 0x402
.LE00B6668:
/* 3B77C8 E00B6668 14AB0003 */  bne       $a1, $t3, .LE00B6678
/* 3B77CC E00B666C 30E200FF */   andi     $v0, $a3, 0xFF
/* 3B77D0 E00B6670 0802D9A6 */  j         .LE00B6698
/* 3B77D4 E00B6674 AC900000 */   sw       $s0, 0x0($a0)
.LE00B6678:
/* 3B77D8 E00B6678 00021400 */  sll       $v0, $v0, 16
/* 3B77DC E00B667C 00091A80 */  sll       $v1, $t1, 10
/* 3B77E0 E00B6680 3063FC00 */  andi      $v1, $v1, 0xFC00
/* 3B77E4 E00B6684 00431025 */  or        $v0, $v0, $v1
/* 3B77E8 E00B6688 310300FF */  andi      $v1, $t0, 0xFF
/* 3B77EC E00B668C 00431025 */  or        $v0, $v0, $v1
.LE00B6690:
/* 3B77F0 E00B6690 004C1025 */  or        $v0, $v0, $t4
/* 3B77F4 E00B6694 AC820000 */  sw        $v0, 0x0($a0)
.LE00B6698:
/* 3B77F8 E00B6698 14A00003 */  bnez      $a1, .LE00B66A8
/* 3B77FC E00B669C 00000000 */   nop
/* 3B7800 E00B66A0 0802D9B5 */  j         .LE00B66D4
/* 3B7804 E00B66A4 AC8F0004 */   sw       $t7, 0x4($a0)
.LE00B66A8:
/* 3B7808 E00B66A8 14AB0003 */  bne       $a1, $t3, .LE00B66B8
/* 3B780C E00B66AC 314200FF */   andi     $v0, $t2, 0xFF
/* 3B7810 E00B66B0 0802D9B5 */  j         .LE00B66D4
/* 3B7814 E00B66B4 AC8E0004 */   sw       $t6, 0x4($a0)
.LE00B66B8:
/* 3B7818 E00B66B8 00021400 */  sll       $v0, $v0, 16
/* 3B781C E00B66BC 30E300FF */  andi      $v1, $a3, 0xFF
/* 3B7820 E00B66C0 00031A00 */  sll       $v1, $v1, 8
/* 3B7824 E00B66C4 00431025 */  or        $v0, $v0, $v1
/* 3B7828 E00B66C8 310300FF */  andi      $v1, $t0, 0xFF
/* 3B782C E00B66CC 00431025 */  or        $v0, $v0, $v1
/* 3B7830 E00B66D0 AC820004 */  sw        $v0, 0x4($a0)
.LE00B66D4:
/* 3B7834 E00B66D4 25080004 */  addiu     $t0, $t0, 0x4
/* 3B7838 E00B66D8 24E70004 */  addiu     $a3, $a3, 0x4
/* 3B783C E00B66DC 25290001 */  addiu     $t1, $t1, 0x1
/* 3B7840 E00B66E0 0126102A */  slt       $v0, $t1, $a2
/* 3B7844 E00B66E4 1440FFD8 */  bnez      $v0, .LE00B6648
/* 3B7848 E00B66E8 254A0004 */   addiu    $t2, $t2, 0x4
.LE00B66EC:
/* 3B784C E00B66EC 3C05D838 */  lui       $a1, (0xD8380002 >> 16)
/* 3B7850 E00B66F0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 3B7854 E00B66F4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 3B7858 E00B66F8 8C620000 */  lw        $v0, 0x0($v1)
/* 3B785C E00B66FC 34A50002 */  ori       $a1, $a1, (0xD8380002 & 0xFFFF)
/* 3B7860 E00B6700 0040202D */  daddu     $a0, $v0, $zero
/* 3B7864 E00B6704 24420008 */  addiu     $v0, $v0, 0x8
/* 3B7868 E00B6708 AC620000 */  sw        $v0, 0x0($v1)
/* 3B786C E00B670C 24020040 */  addiu     $v0, $zero, 0x40
/* 3B7870 E00B6710 AC850000 */  sw        $a1, 0x0($a0)
/* 3B7874 E00B6714 AC820004 */  sw        $v0, 0x4($a0)
/* 3B7878 E00B6718 8FBF00B0 */  lw        $ra, 0xB0($sp)
/* 3B787C E00B671C 8FB700AC */  lw        $s7, 0xAC($sp)
/* 3B7880 E00B6720 8FB600A8 */  lw        $s6, 0xA8($sp)
/* 3B7884 E00B6724 8FB500A4 */  lw        $s5, 0xA4($sp)
/* 3B7888 E00B6728 8FB400A0 */  lw        $s4, 0xA0($sp)
/* 3B788C E00B672C 8FB3009C */  lw        $s3, 0x9C($sp)
/* 3B7890 E00B6730 8FB20098 */  lw        $s2, 0x98($sp)
/* 3B7894 E00B6734 8FB10094 */  lw        $s1, 0x94($sp)
/* 3B7898 E00B6738 8FB00090 */  lw        $s0, 0x90($sp)
/* 3B789C E00B673C D7B400B8 */  ldc1      $f20, 0xB8($sp)
/* 3B78A0 E00B6740 03E00008 */  jr        $ra
/* 3B78A4 E00B6744 27BD00C0 */   addiu    $sp, $sp, 0xC0
/* 3B78A8 E00B6748 00000000 */  nop
/* 3B78AC E00B674C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void waterfall_appendGfx(void* effect) {
    WaterfallFXData* data = ((EffectInstance*)effect)->data.waterfall;
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 unk_14 = data->unk_14;
    s32 unk_24 = data->unk_24;
    f32 scale = data->unk_28 * 0.1;
    s32 savedIdx;
    Vtx_t* vtx;
    Gfx* savedGfxPos;
    Matrix4f sp10;
    Matrix4f sp50;
    s32 i;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));

    shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
    shim_guScaleF(sp50, scale, scale, scale);
    shim_guMtxCatF(sp50, sp10, sp10);
    shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24);
    gSPDisplayList(gMainGfxPos++, D_09000200_3B7AD0);
    gSPBranchList(gMainGfxPos, &gMainGfxPos[49]);

    savedGfxPos = gMainGfxPos + 1;
    gMainGfxPos = &gMainGfxPos[49];

    vtx = (Vtx_t*) savedGfxPos;

    for (i = 0; i < ARRAY_COUNT(data->unk_2C); i++) {
        vtx->ob[0] = i * 50 - 300;
        vtx->ob[1] = 600;
        vtx->ob[2] = 0;
        vtx->tc[0] = (unk_14 + i * 4) * 32;
        vtx->tc[1] = (s32) data->unk_2C[i] * 32;
        vtx->cn[0] = 255;
        vtx->cn[1] = 255;
        vtx->cn[2] = 255;
        vtx->cn[3] = -i * 20 - 1;
        vtx++;

        vtx->ob[0] = i * 50 - 300;
        vtx->ob[1] = (data->unk_2C[i] + 60.0f) * 10.0f;
        vtx->ob[2] = 0;
        vtx->tc[0] = (unk_14 + i * 4) * 32;
        vtx->tc[1] = 1024;
        vtx->cn[0] = 255;
        vtx->cn[1] = 255;
        vtx->cn[2] = 255;
        vtx->cn[3] = -i * 20 - 1;
        vtx++;
    }

    savedIdx = i;

    gSPVertex(gMainGfxPos++, savedGfxPos, i * 2, 0);

    for (i = 0; i < savedIdx - 1; i++) {
        s32 i2 = i * 2;
        gSP2Triangles(gMainGfxPos++,
            i2    , i2 + 2, i2 + 1, i2,
            i2 + 1, i2 + 2, i2 + 3, i2);
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel explosion_appendGfx
/* 343ADC E003245C 27BDFF30 */  addiu     $sp, $sp, -0xD0
/* 343AE0 E0032460 0080302D */  daddu     $a2, $a0, $zero
/* 343AE4 E0032464 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 343AE8 E0032468 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 343AEC E003246C 27A40018 */  addiu     $a0, $sp, 0x18
/* 343AF0 E0032470 AFB600B0 */  sw        $s6, 0xB0($sp)
/* 343AF4 E0032474 3C160001 */  lui       $s6, (0x11630 >> 16)
/* 343AF8 E0032478 36D61630 */  ori       $s6, $s6, (0x11630 & 0xFFFF)
/* 343AFC E003247C AFB200A0 */  sw        $s2, 0xA0($sp)
/* 343B00 E0032480 3C12800A */  lui       $s2, %hi(gMainGfxPos)
/* 343B04 E0032484 2652A66C */  addiu     $s2, $s2, %lo(gMainGfxPos)
/* 343B08 E0032488 AFBF00B8 */  sw        $ra, 0xB8($sp)
/* 343B0C E003248C AFB700B4 */  sw        $s7, 0xB4($sp)
/* 343B10 E0032490 AFB500AC */  sw        $s5, 0xAC($sp)
/* 343B14 E0032494 AFB400A8 */  sw        $s4, 0xA8($sp)
/* 343B18 E0032498 AFB300A4 */  sw        $s3, 0xA4($sp)
/* 343B1C E003249C AFB1009C */  sw        $s1, 0x9C($sp)
/* 343B20 E00324A0 AFB00098 */  sw        $s0, 0x98($sp)
/* 343B24 E00324A4 F7B600C8 */  sdc1      $f22, 0xC8($sp)
/* 343B28 E00324A8 F7B400C0 */  sdc1      $f20, 0xC0($sp)
/* 343B2C E00324AC 8E450000 */  lw        $a1, 0x0($s2)
/* 343B30 E00324B0 8CD1000C */  lw        $s1, 0xC($a2)
/* 343B34 E00324B4 00A0182D */  daddu     $v1, $a1, $zero
/* 343B38 E00324B8 24A50008 */  addiu     $a1, $a1, 0x8
/* 343B3C E00324BC AE450000 */  sw        $a1, 0x0($s2)
/* 343B40 E00324C0 8E330034 */  lw        $s3, 0x34($s1)
/* 343B44 E00324C4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 343B48 E00324C8 AC620000 */  sw        $v0, 0x0($v1)
/* 343B4C E00324CC AC600004 */  sw        $zero, 0x4($v1)
/* 343B50 E00324D0 ACA70000 */  sw        $a3, 0x0($a1)
/* 343B54 E00324D4 8CC30010 */  lw        $v1, 0x10($a2)
/* 343B58 E00324D8 24A20008 */  addiu     $v0, $a1, 0x8
/* 343B5C E00324DC AE420000 */  sw        $v0, 0x0($s2)
/* 343B60 E00324E0 8C62001C */  lw        $v0, 0x1C($v1)
/* 343B64 E00324E4 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 343B68 E00324E8 00431021 */  addu      $v0, $v0, $v1
/* 343B6C E00324EC ACA20004 */  sw        $v0, 0x4($a1)
/* 343B70 E00324F0 8E250004 */  lw        $a1, 0x4($s1)
/* 343B74 E00324F4 8E260008 */  lw        $a2, 0x8($s1)
/* 343B78 E00324F8 8E27000C */  lw        $a3, 0xC($s1)
/* 343B7C E00324FC 0C080108 */  jal       shim_guTranslateF
/* 343B80 E0032500 2631003C */   addiu    $s1, $s1, 0x3C
/* 343B84 E0032504 27B50058 */  addiu     $s5, $sp, 0x58
/* 343B88 E0032508 4480B000 */  mtc1      $zero, $f22
/* 343B8C E003250C 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 343B90 E0032510 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 343B94 E0032514 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 343B98 E0032518 4481A000 */  mtc1      $at, $f20
/* 343B9C E003251C 00031080 */  sll       $v0, $v1, 2
/* 343BA0 E0032520 00431021 */  addu      $v0, $v0, $v1
/* 343BA4 E0032524 00021080 */  sll       $v0, $v0, 2
/* 343BA8 E0032528 00431023 */  subu      $v0, $v0, $v1
/* 343BAC E003252C 000218C0 */  sll       $v1, $v0, 3
/* 343BB0 E0032530 00431021 */  addu      $v0, $v0, $v1
/* 343BB4 E0032534 000210C0 */  sll       $v0, $v0, 3
/* 343BB8 E0032538 4406B000 */  mfc1      $a2, $f22
/* 343BBC E003253C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 343BC0 E0032540 00220821 */  addu      $at, $at, $v0
/* 343BC4 E0032544 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 343BC8 E0032548 4407A000 */  mfc1      $a3, $f20
/* 343BCC E003254C 46000007 */  neg.s     $f0, $f0
/* 343BD0 E0032550 44050000 */  mfc1      $a1, $f0
/* 343BD4 E0032554 02A0202D */  daddu     $a0, $s5, $zero
/* 343BD8 E0032558 0C080104 */  jal       shim_guRotateF
/* 343BDC E003255C E7B60010 */   swc1     $f22, 0x10($sp)
/* 343BE0 E0032560 02A0202D */  daddu     $a0, $s5, $zero
/* 343BE4 E0032564 27A50018 */  addiu     $a1, $sp, 0x18
/* 343BE8 E0032568 0C080114 */  jal       shim_guMtxCatF
/* 343BEC E003256C 00A0302D */   daddu    $a2, $a1, $zero
/* 343BF0 E0032570 27A40018 */  addiu     $a0, $sp, 0x18
/* 343BF4 E0032574 3C148007 */  lui       $s4, %hi(gMatrixListPos)
/* 343BF8 E0032578 269441F0 */  addiu     $s4, $s4, %lo(gMatrixListPos)
/* 343BFC E003257C 3C17800A */  lui       $s7, %hi(gDisplayContext)
/* 343C00 E0032580 26F7A674 */  addiu     $s7, $s7, %lo(gDisplayContext)
/* 343C04 E0032584 96850000 */  lhu       $a1, 0x0($s4)
/* 343C08 E0032588 8EE20000 */  lw        $v0, 0x0($s7)
/* 343C0C E003258C 00052980 */  sll       $a1, $a1, 6
/* 343C10 E0032590 00B62821 */  addu      $a1, $a1, $s6
/* 343C14 E0032594 0C080118 */  jal       shim_guMtxF2L
/* 343C18 E0032598 00452821 */   addu     $a1, $v0, $a1
/* 343C1C E003259C 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 343C20 E00325A0 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 343C24 E00325A4 8E460000 */  lw        $a2, 0x0($s2)
/* 343C28 E00325A8 96820000 */  lhu       $v0, 0x0($s4)
/* 343C2C E00325AC 00C0202D */  daddu     $a0, $a2, $zero
/* 343C30 E00325B0 24C60008 */  addiu     $a2, $a2, 0x8
/* 343C34 E00325B4 AE460000 */  sw        $a2, 0x0($s2)
/* 343C38 E00325B8 AC830000 */  sw        $v1, 0x0($a0)
/* 343C3C E00325BC 24430001 */  addiu     $v1, $v0, 0x1
/* 343C40 E00325C0 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 343C44 E00325C4 00021180 */  sll       $v0, $v0, 6
/* 343C48 E00325C8 A6830000 */  sh        $v1, 0x0($s4)
/* 343C4C E00325CC 8EE30000 */  lw        $v1, 0x0($s7)
/* 343C50 E00325D0 00561021 */  addu      $v0, $v0, $s6
/* 343C54 E00325D4 00621821 */  addu      $v1, $v1, $v0
/* 343C58 E00325D8 AC830004 */  sw        $v1, 0x4($a0)
/* 343C5C E00325DC 8E230000 */  lw        $v1, 0x0($s1)
/* 343C60 E00325E0 2402FFFF */  addiu     $v0, $zero, -0x1
/* 343C64 E00325E4 10620037 */  beq       $v1, $v0, .LE00326C4
/* 343C68 E00325E8 27A40018 */   addiu    $a0, $sp, 0x18
/* 343C6C E00325EC 3C10DE00 */  lui       $s0, (0xDE000000 >> 16)
/* 343C70 E00325F0 3C020900 */  lui       $v0, %hi(D_09000840_4158A0)
/* 343C74 E00325F4 24420840 */  addiu     $v0, $v0, %lo(D_09000840_4158A0)
/* 343C78 E00325F8 ACD00000 */  sw        $s0, 0x0($a2)
/* 343C7C E00325FC ACC20004 */  sw        $v0, 0x4($a2)
/* 343C80 E0032600 8E250020 */  lw        $a1, 0x20($s1)
/* 343C84 E0032604 4407A000 */  mfc1      $a3, $f20
/* 343C88 E0032608 24C20008 */  addiu     $v0, $a2, 0x8
/* 343C8C E003260C AE420000 */  sw        $v0, 0x0($s2)
/* 343C90 E0032610 0C080110 */  jal       shim_guScaleF
/* 343C94 E0032614 00A0302D */   daddu    $a2, $a1, $zero
/* 343C98 E0032618 27A40018 */  addiu     $a0, $sp, 0x18
/* 343C9C E003261C 96850000 */  lhu       $a1, 0x0($s4)
/* 343CA0 E0032620 8EE20000 */  lw        $v0, 0x0($s7)
/* 343CA4 E0032624 00052980 */  sll       $a1, $a1, 6
/* 343CA8 E0032628 00B62821 */  addu      $a1, $a1, $s6
/* 343CAC E003262C 0C080118 */  jal       shim_guMtxF2L
/* 343CB0 E0032630 00452821 */   addu     $a1, $v0, $a1
/* 343CB4 E0032634 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 343CB8 E0032638 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 343CBC E003263C 8E440000 */  lw        $a0, 0x0($s2)
/* 343CC0 E0032640 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 343CC4 E0032644 0080302D */  daddu     $a2, $a0, $zero
/* 343CC8 E0032648 24840008 */  addiu     $a0, $a0, 0x8
/* 343CCC E003264C AE440000 */  sw        $a0, 0x0($s2)
/* 343CD0 E0032650 ACC20000 */  sw        $v0, 0x0($a2)
/* 343CD4 E0032654 9225003B */  lbu       $a1, 0x3B($s1)
/* 343CD8 E0032658 96830000 */  lhu       $v1, 0x0($s4)
/* 343CDC E003265C 24820008 */  addiu     $v0, $a0, 0x8
/* 343CE0 E0032660 AE420000 */  sw        $v0, 0x0($s2)
/* 343CE4 E0032664 24620001 */  addiu     $v0, $v1, 0x1
/* 343CE8 E0032668 A6820000 */  sh        $v0, 0x0($s4)
/* 343CEC E003266C 24820010 */  addiu     $v0, $a0, 0x10
/* 343CF0 E0032670 AE420000 */  sw        $v0, 0x0($s2)
/* 343CF4 E0032674 24820018 */  addiu     $v0, $a0, 0x18
/* 343CF8 E0032678 AE420000 */  sw        $v0, 0x0($s2)
/* 343CFC E003267C 2402F000 */  addiu     $v0, $zero, -0x1000
/* 343D00 E0032680 00A22825 */  or        $a1, $a1, $v0
/* 343D04 E0032684 3C02DA38 */  lui       $v0, (0xDA380000 >> 16)
/* 343D08 E0032688 3063FFFF */  andi      $v1, $v1, 0xFFFF
/* 343D0C E003268C 00031980 */  sll       $v1, $v1, 6
/* 343D10 E0032690 ACC50004 */  sw        $a1, 0x4($a2)
/* 343D14 E0032694 AC820000 */  sw        $v0, 0x0($a0)
/* 343D18 E0032698 8EE20000 */  lw        $v0, 0x0($s7)
/* 343D1C E003269C 00761821 */  addu      $v1, $v1, $s6
/* 343D20 E00326A0 AC900008 */  sw        $s0, 0x8($a0)
/* 343D24 E00326A4 AC870010 */  sw        $a3, 0x10($a0)
/* 343D28 E00326A8 00431021 */  addu      $v0, $v0, $v1
/* 343D2C E00326AC AC820004 */  sw        $v0, 0x4($a0)
/* 343D30 E00326B0 3C020900 */  lui       $v0, %hi(D_090008F0_415950)
/* 343D34 E00326B4 244208F0 */  addiu     $v0, $v0, %lo(D_090008F0_415950)
/* 343D38 E00326B8 AC82000C */  sw        $v0, 0xC($a0)
/* 343D3C E00326BC 24020040 */  addiu     $v0, $zero, 0x40
/* 343D40 E00326C0 AC820014 */  sw        $v0, 0x14($a0)
.LE00326C4:
/* 343D44 E00326C4 2631003C */  addiu     $s1, $s1, 0x3C
/* 343D48 E00326C8 27A40018 */  addiu     $a0, $sp, 0x18
/* 343D4C E00326CC 8E430000 */  lw        $v1, 0x0($s2)
/* 343D50 E00326D0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 343D54 E00326D4 0060282D */  daddu     $a1, $v1, $zero
/* 343D58 E00326D8 ACA20000 */  sw        $v0, 0x0($a1)
/* 343D5C E00326DC 3C020900 */  lui       $v0, %hi(D_09000910_415970)
/* 343D60 E00326E0 24420910 */  addiu     $v0, $v0, %lo(D_09000910_415970)
/* 343D64 E00326E4 ACA20004 */  sw        $v0, 0x4($a1)
/* 343D68 E00326E8 8E250020 */  lw        $a1, 0x20($s1)
/* 343D6C E00326EC 24630008 */  addiu     $v1, $v1, 0x8
/* 343D70 E00326F0 AE430000 */  sw        $v1, 0x0($s2)
/* 343D74 E00326F4 00A0302D */  daddu     $a2, $a1, $zero
/* 343D78 E00326F8 0C080110 */  jal       shim_guScaleF
/* 343D7C E00326FC 00A0382D */   daddu    $a3, $a1, $zero
/* 343D80 E0032700 4406B000 */  mfc1      $a2, $f22
/* 343D84 E0032704 02A0202D */  daddu     $a0, $s5, $zero
/* 343D88 E0032708 E7B40010 */  swc1      $f20, 0x10($sp)
/* 343D8C E003270C 8E250028 */  lw        $a1, 0x28($s1)
/* 343D90 E0032710 0C080104 */  jal       shim_guRotateF
/* 343D94 E0032714 00C0382D */   daddu    $a3, $a2, $zero
/* 343D98 E0032718 02A0202D */  daddu     $a0, $s5, $zero
/* 343D9C E003271C 27A50018 */  addiu     $a1, $sp, 0x18
/* 343DA0 E0032720 0C080114 */  jal       shim_guMtxCatF
/* 343DA4 E0032724 00A0302D */   daddu    $a2, $a1, $zero
/* 343DA8 E0032728 27A40018 */  addiu     $a0, $sp, 0x18
/* 343DAC E003272C 96850000 */  lhu       $a1, 0x0($s4)
/* 343DB0 E0032730 8EE20000 */  lw        $v0, 0x0($s7)
/* 343DB4 E0032734 00052980 */  sll       $a1, $a1, 6
/* 343DB8 E0032738 00B62821 */  addu      $a1, $a1, $s6
/* 343DBC E003273C 0C080118 */  jal       shim_guMtxF2L
/* 343DC0 E0032740 00452821 */   addu     $a1, $v0, $a1
/* 343DC4 E0032744 24020001 */  addiu     $v0, $zero, 0x1
/* 343DC8 E0032748 12620006 */  beq       $s3, $v0, .LE0032764
/* 343DCC E003274C 24020002 */   addiu    $v0, $zero, 0x2
/* 343DD0 E0032750 12620005 */  beq       $s3, $v0, .LE0032768
/* 343DD4 E0032754 240400FF */   addiu    $a0, $zero, 0xFF
/* 343DD8 E0032758 8E240038 */  lw        $a0, 0x38($s1)
/* 343DDC E003275C 0800C9DB */  j         .LE003276C
/* 343DE0 E0032760 2A620003 */   slti     $v0, $s3, 0x3
.LE0032764:
/* 343DE4 E0032764 240400C0 */  addiu     $a0, $zero, 0xC0
.LE0032768:
/* 343DE8 E0032768 2A620003 */  slti      $v0, $s3, 0x3
.LE003276C:
/* 343DEC E003276C 14400005 */  bnez      $v0, .LE0032784
/* 343DF0 E0032770 240300FF */   addiu    $v1, $zero, 0xFF
/* 343DF4 E0032774 2A620008 */  slti      $v0, $s3, 0x8
/* 343DF8 E0032778 10400002 */  beqz      $v0, .LE0032784
/* 343DFC E003277C 00131100 */   sll      $v0, $s3, 4
/* 343E00 E0032780 24430080 */  addiu     $v1, $v0, 0x80
.LE0032784:
/* 343E04 E0032784 3C080001 */  lui       $t0, (0x11630 >> 16)
/* 343E08 E0032788 35081630 */  ori       $t0, $t0, (0x11630 & 0xFFFF)
/* 343E0C E003278C 3C0A5555 */  lui       $t2, (0x55555556 >> 16)
/* 343E10 E0032790 354A5556 */  ori       $t2, $t2, (0x55555556 & 0xFFFF)
/* 343E14 E0032794 3C09D838 */  lui       $t1, (0xD8380002 >> 16)
/* 343E18 E0032798 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 343E1C E003279C 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 343E20 E00327A0 35290002 */  ori       $t1, $t1, (0xD8380002 & 0xFFFF)
/* 343E24 E00327A4 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 343E28 E00327A8 306300FF */  andi      $v1, $v1, 0xFF
/* 343E2C E00327AC 00031A00 */  sll       $v1, $v1, 8
/* 343E30 E00327B0 8CC50000 */  lw        $a1, 0x0($a2)
/* 343E34 E00327B4 026A0018 */  mult      $s3, $t2
/* 343E38 E00327B8 00A0382D */  daddu     $a3, $a1, $zero
/* 343E3C E00327BC 24A50008 */  addiu     $a1, $a1, 0x8
/* 343E40 E00327C0 ACC50000 */  sw        $a1, 0x0($a2)
/* 343E44 E00327C4 ACE20000 */  sw        $v0, 0x0($a3)
/* 343E48 E00327C8 308200FF */  andi      $v0, $a0, 0xFF
/* 343E4C E00327CC 3C04FFFF */  lui       $a0, (0xFFFF0000 >> 16)
/* 343E50 E00327D0 00441025 */  or        $v0, $v0, $a0
/* 343E54 E00327D4 00621825 */  or        $v1, $v1, $v0
/* 343E58 E00327D8 24A20008 */  addiu     $v0, $a1, 0x8
/* 343E5C E00327DC 3C048007 */  lui       $a0, %hi(gMatrixListPos)
/* 343E60 E00327E0 248441F0 */  addiu     $a0, $a0, %lo(gMatrixListPos)
/* 343E64 E00327E4 ACE30004 */  sw        $v1, 0x4($a3)
/* 343E68 E00327E8 ACC20000 */  sw        $v0, 0x0($a2)
/* 343E6C E00327EC 94820000 */  lhu       $v0, 0x0($a0)
/* 343E70 E00327F0 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 343E74 E00327F4 ACA30000 */  sw        $v1, 0x0($a1)
/* 343E78 E00327F8 24430001 */  addiu     $v1, $v0, 0x1
/* 343E7C E00327FC 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 343E80 E0032800 00021180 */  sll       $v0, $v0, 6
/* 343E84 E0032804 A4830000 */  sh        $v1, 0x0($a0)
/* 343E88 E0032808 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 343E8C E003280C 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 343E90 E0032810 00481021 */  addu      $v0, $v0, $t0
/* 343E94 E0032814 00621821 */  addu      $v1, $v1, $v0
/* 343E98 E0032818 24A20010 */  addiu     $v0, $a1, 0x10
/* 343E9C E003281C ACA30004 */  sw        $v1, 0x4($a1)
/* 343EA0 E0032820 ACC20000 */  sw        $v0, 0x0($a2)
/* 343EA4 E0032824 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 343EA8 E0032828 ACA20008 */  sw        $v0, 0x8($a1)
/* 343EAC E003282C 24A20018 */  addiu     $v0, $a1, 0x18
/* 343EB0 E0032830 00131FC3 */  sra       $v1, $s3, 31
/* 343EB4 E0032834 ACC20000 */  sw        $v0, 0x0($a2)
/* 343EB8 E0032838 00005810 */  mfhi      $t3
/* 343EBC E003283C 01631823 */  subu      $v1, $t3, $v1
/* 343EC0 E0032840 00031040 */  sll       $v0, $v1, 1
/* 343EC4 E0032844 00431021 */  addu      $v0, $v0, $v1
/* 343EC8 E0032848 02621023 */  subu      $v0, $s3, $v0
/* 343ECC E003284C 00021080 */  sll       $v0, $v0, 2
/* 343ED0 E0032850 3C03E003 */  lui       $v1, (0xE00328B0 >> 16)
/* 343ED4 E0032854 00621821 */  addu      $v1, $v1, $v0
/* 343ED8 E0032858 8C6328B0 */  lw        $v1, (0xE00328B0 & 0xFFFF)($v1)
/* 343EDC E003285C 24A20020 */  addiu     $v0, $a1, 0x20
/* 343EE0 E0032860 ACC20000 */  sw        $v0, 0x0($a2)
/* 343EE4 E0032864 24020040 */  addiu     $v0, $zero, 0x40
/* 343EE8 E0032868 ACA90010 */  sw        $t1, 0x10($a1)
/* 343EEC E003286C ACA20014 */  sw        $v0, 0x14($a1)
/* 343EF0 E0032870 ACA90018 */  sw        $t1, 0x18($a1)
/* 343EF4 E0032874 ACA2001C */  sw        $v0, 0x1C($a1)
/* 343EF8 E0032878 ACA3000C */  sw        $v1, 0xC($a1)
/* 343EFC E003287C 8FBF00B8 */  lw        $ra, 0xB8($sp)
/* 343F00 E0032880 8FB700B4 */  lw        $s7, 0xB4($sp)
/* 343F04 E0032884 8FB600B0 */  lw        $s6, 0xB0($sp)
/* 343F08 E0032888 8FB500AC */  lw        $s5, 0xAC($sp)
/* 343F0C E003288C 8FB400A8 */  lw        $s4, 0xA8($sp)
/* 343F10 E0032890 8FB300A4 */  lw        $s3, 0xA4($sp)
/* 343F14 E0032894 8FB200A0 */  lw        $s2, 0xA0($sp)
/* 343F18 E0032898 8FB1009C */  lw        $s1, 0x9C($sp)
/* 343F1C E003289C 8FB00098 */  lw        $s0, 0x98($sp)
/* 343F20 E00328A0 D7B600C8 */  ldc1      $f22, 0xC8($sp)
/* 343F24 E00328A4 D7B400C0 */  ldc1      $f20, 0xC0($sp)
/* 343F28 E00328A8 03E00008 */  jr        $ra
/* 343F2C E00328AC 27BD00D0 */   addiu    $sp, $sp, 0xD0

### DECOMPILED C INSTRUCTIONS:

void explosion_appendGfx(void* effect) {
    ExplosionFXData* part = ((EffectInstance*)effect)->data.explosion;
    s32 unk_34 = part->unk_34;
    Matrix4f sp18;
    Matrix4f sp58;
    s32 primAlpha;
    s32 primB;
    s32 cond;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));

    shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
    shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    part++;

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

    if (part->unk_00 != -1) {
        gSPDisplayList(gMainGfxPos++, D_09000840_3447B0);

        shim_guScaleF(sp18, part->unk_20, part->unk_20, 1.0f);
        shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

        gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->unk_38);
        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, D_090008F0_344860);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }

    part++;

    gSPDisplayList(gMainGfxPos++, D_09000910_344880);

    shim_guScaleF(sp18, part->unk_20, part->unk_20, part->unk_20);
    shim_guRotateF(sp58, part->unk_28, 0.0f, 0.0f, 1.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    switch (unk_34) {
        default:
            primAlpha = part->unk_38;
            break;
        case 2:
            primAlpha = 255;
            break;
        case 1:
            primAlpha = 192;
            break;
    }

    cond = (unk_34 < 3); // required to match
    if (!cond && unk_34 < 8) {
        primB = unk_34 * 16 + 128;
    } else {
        primB = 255;
    }

    gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, primB, primAlpha);
    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gSPDisplayList(gMainGfxPos++, D_E00328B0[unk_34 % 3]);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}