### RAW ASSEMBLY INSTRUCTIONS:

glabel embers_update
/* 3DB638 E00E01D8 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 3DB63C E00E01DC AFB20020 */  sw        $s2, 0x20($sp)
/* 3DB640 E00E01E0 0080902D */  daddu     $s2, $a0, $zero
/* 3DB644 E00E01E4 AFBF0028 */  sw        $ra, 0x28($sp)
/* 3DB648 E00E01E8 AFB30024 */  sw        $s3, 0x24($sp)
/* 3DB64C E00E01EC AFB1001C */  sw        $s1, 0x1C($sp)
/* 3DB650 E00E01F0 AFB00018 */  sw        $s0, 0x18($sp)
/* 3DB654 E00E01F4 F7BE0058 */  sdc1      $f30, 0x58($sp)
/* 3DB658 E00E01F8 F7BC0050 */  sdc1      $f28, 0x50($sp)
/* 3DB65C E00E01FC F7BA0048 */  sdc1      $f26, 0x48($sp)
/* 3DB660 E00E0200 F7B80040 */  sdc1      $f24, 0x40($sp)
/* 3DB664 E00E0204 F7B60038 */  sdc1      $f22, 0x38($sp)
/* 3DB668 E00E0208 F7B40030 */  sdc1      $f20, 0x30($sp)
/* 3DB66C E00E020C 8E430000 */  lw        $v1, 0x0($s2)
/* 3DB670 E00E0210 8E44000C */  lw        $a0, 0xC($s2)
/* 3DB674 E00E0214 30620010 */  andi      $v0, $v1, 0x10
/* 3DB678 E00E0218 10400005 */  beqz      $v0, .LE00E0230
/* 3DB67C E00E021C 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3DB680 E00E0220 00621024 */  and       $v0, $v1, $v0
/* 3DB684 E00E0224 AE420000 */  sw        $v0, 0x0($s2)
/* 3DB688 E00E0228 24020010 */  addiu     $v0, $zero, 0x10
/* 3DB68C E00E022C AC820018 */  sw        $v0, 0x18($a0)
.LE00E0230:
/* 3DB690 E00E0230 8C830018 */  lw        $v1, 0x18($a0)
/* 3DB694 E00E0234 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3DB698 E00E0238 10400002 */  beqz      $v0, .LE00E0244
/* 3DB69C E00E023C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3DB6A0 E00E0240 AC820018 */  sw        $v0, 0x18($a0)
.LE00E0244:
/* 3DB6A4 E00E0244 3C030004 */  lui       $v1, (0x4F1A0 >> 16)
/* 3DB6A8 E00E0248 8C82001C */  lw        $v0, 0x1C($a0)
/* 3DB6AC E00E024C 3463F1A0 */  ori       $v1, $v1, (0x4F1A0 & 0xFFFF)
/* 3DB6B0 E00E0250 24420001 */  addiu     $v0, $v0, 0x1
/* 3DB6B4 E00E0254 0062182A */  slt       $v1, $v1, $v0
/* 3DB6B8 E00E0258 10600003 */  beqz      $v1, .LE00E0268
/* 3DB6BC E00E025C AC82001C */   sw       $v0, 0x1C($a0)
/* 3DB6C0 E00E0260 24020100 */  addiu     $v0, $zero, 0x100
/* 3DB6C4 E00E0264 AC82001C */  sw        $v0, 0x1C($a0)
.LE00E0268:
/* 3DB6C8 E00E0268 8C830018 */  lw        $v1, 0x18($a0)
/* 3DB6CC E00E026C 04610005 */  bgez      $v1, .LE00E0284
/* 3DB6D0 E00E0270 28620010 */   slti     $v0, $v1, 0x10
/* 3DB6D4 E00E0274 0C080128 */  jal       shim_remove_effect
/* 3DB6D8 E00E0278 0240202D */   daddu    $a0, $s2, $zero
/* 3DB6DC E00E027C 0803815F */  j         .LE00E057C
/* 3DB6E0 E00E0280 00000000 */   nop
.LE00E0284:
/* 3DB6E4 E00E0284 8C85001C */  lw        $a1, 0x1C($a0)
/* 3DB6E8 E00E0288 10400002 */  beqz      $v0, .LE00E0294
/* 3DB6EC E00E028C 00031100 */   sll      $v0, $v1, 4
/* 3DB6F0 E00E0290 AC82002C */  sw        $v0, 0x2C($a0)
.LE00E0294:
/* 3DB6F4 E00E0294 28A20010 */  slti      $v0, $a1, 0x10
/* 3DB6F8 E00E0298 10400003 */  beqz      $v0, .LE00E02A8
/* 3DB6FC E00E029C 00051100 */   sll      $v0, $a1, 4
/* 3DB700 E00E02A0 2442000F */  addiu     $v0, $v0, 0xF
/* 3DB704 E00E02A4 AC82002C */  sw        $v0, 0x2C($a0)
.LE00E02A8:
/* 3DB708 E00E02A8 C4980010 */  lwc1      $f24, 0x10($a0)
/* 3DB70C E00E02AC C49E0014 */  lwc1      $f30, 0x14($a0)
/* 3DB710 E00E02B0 C49C0068 */  lwc1      $f28, 0x68($a0)
/* 3DB714 E00E02B4 C49A006C */  lwc1      $f26, 0x6C($a0)
/* 3DB718 E00E02B8 E7BA0010 */  swc1      $f26, 0x10($sp)
/* 3DB71C E00E02BC 8E420008 */  lw        $v0, 0x8($s2)
/* 3DB720 E00E02C0 24110001 */  addiu     $s1, $zero, 0x1
/* 3DB724 E00E02C4 0222102A */  slt       $v0, $s1, $v0
/* 3DB728 E00E02C8 104000AC */  beqz      $v0, .LE00E057C
/* 3DB72C E00E02CC 24840070 */   addiu    $a0, $a0, 0x70
/* 3DB730 E00E02D0 3C13E00E */  lui       $s3, %hi(D_E00E0A48)
/* 3DB734 E00E02D4 26730A48 */  addiu     $s3, $s3, %lo(D_E00E0A48)
/* 3DB738 E00E02D8 2490004C */  addiu     $s0, $a0, 0x4C
/* 3DB73C E00E02DC 3C01E00E */  lui       $at, (0xE00E0AC0 >> 16)
/* 3DB740 E00E02E0 D4340AC0 */  ldc1      $f20, (0xE00E0AC0 & 0xFFFF)($at)
/* 3DB744 E00E02E4 3C01E00E */  lui       $at, (0xE00E0AC8 >> 16)
/* 3DB748 E00E02E8 D4360AC8 */  ldc1      $f22, (0xE00E0AC8 & 0xFFFF)($at)
.LE00E02EC:
/* 3DB74C E00E02EC 8E020018 */  lw        $v0, 0x18($s0)
/* 3DB750 E00E02F0 24420001 */  addiu     $v0, $v0, 0x1
/* 3DB754 E00E02F4 AE020018 */  sw        $v0, 0x18($s0)
/* 3DB758 E00E02F8 2842001E */  slti      $v0, $v0, 0x1E
/* 3DB75C E00E02FC 50400001 */  beql      $v0, $zero, .LE00E0304
/* 3DB760 E00E0300 AE000018 */   sw       $zero, 0x18($s0)
.LE00E0304:
/* 3DB764 E00E0304 8E020018 */  lw        $v0, 0x18($s0)
/* 3DB768 E00E0308 04420098 */  bltzl     $v0, .LE00E056C
/* 3DB76C E00E030C 26310001 */   addiu    $s1, $s1, 0x1
/* 3DB770 E00E0310 14400058 */  bnez      $v0, .LE00E0474
/* 3DB774 E00E0314 00000000 */   nop
/* 3DB778 E00E0318 4600C68D */  trunc.w.s $f26, $f24
/* 3DB77C E00E031C 4404D000 */  mfc1      $a0, $f26
/* 3DB780 E00E0320 0C080138 */  jal       shim_rand_int
/* 3DB784 E00E0324 00000000 */   nop
/* 3DB788 E00E0328 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3DB78C E00E032C 44810800 */  mtc1      $at, $f1
/* 3DB790 E00E0330 44800000 */  mtc1      $zero, $f0
/* 3DB794 E00E0334 4600C0A1 */  cvt.d.s   $f2, $f24
/* 3DB798 E00E0338 46201082 */  mul.d     $f2, $f2, $f0
/* 3DB79C E00E033C 00000000 */  nop
/* 3DB7A0 E00E0340 44820000 */  mtc1      $v0, $f0
/* 3DB7A4 E00E0344 00000000 */  nop
/* 3DB7A8 E00E0348 46800021 */  cvt.d.w   $f0, $f0
/* 3DB7AC E00E034C 46220001 */  sub.d     $f0, $f0, $f2
/* 3DB7B0 E00E0350 4600F68D */  trunc.w.s $f26, $f30
/* 3DB7B4 E00E0354 4404D000 */  mfc1      $a0, $f26
/* 3DB7B8 E00E0358 46200020 */  cvt.s.d   $f0, $f0
/* 3DB7BC E00E035C 0C080138 */  jal       shim_rand_int
/* 3DB7C0 E00E0360 E600FFB8 */   swc1     $f0, -0x48($s0)
/* 3DB7C4 E00E0364 24040014 */  addiu     $a0, $zero, 0x14
/* 3DB7C8 E00E0368 44820000 */  mtc1      $v0, $f0
/* 3DB7CC E00E036C 00000000 */  nop
/* 3DB7D0 E00E0370 46800020 */  cvt.s.w   $f0, $f0
/* 3DB7D4 E00E0374 E600FFBC */  swc1      $f0, -0x44($s0)
/* 3DB7D8 E00E0378 0C080138 */  jal       shim_rand_int
/* 3DB7DC E00E037C AE00FFC0 */   sw       $zero, -0x40($s0)
/* 3DB7E0 E00E0380 2442FFF6 */  addiu     $v0, $v0, -0xA
/* 3DB7E4 E00E0384 44820000 */  mtc1      $v0, $f0
/* 3DB7E8 E00E0388 00000000 */  nop
/* 3DB7EC E00E038C 46800020 */  cvt.s.w   $f0, $f0
/* 3DB7F0 E00E0390 46000021 */  cvt.d.s   $f0, $f0
/* 3DB7F4 E00E0394 46340002 */  mul.d     $f0, $f0, $f20
/* 3DB7F8 E00E0398 00000000 */  nop
/* 3DB7FC E00E039C 24040028 */  addiu     $a0, $zero, 0x28
/* 3DB800 E00E03A0 46200020 */  cvt.s.d   $f0, $f0
/* 3DB804 E00E03A4 0C080138 */  jal       shim_rand_int
/* 3DB808 E00E03A8 E600FFF8 */   swc1     $f0, -0x8($s0)
/* 3DB80C E00E03AC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3DB810 E00E03B0 44820000 */  mtc1      $v0, $f0
/* 3DB814 E00E03B4 00000000 */  nop
/* 3DB818 E00E03B8 46800020 */  cvt.s.w   $f0, $f0
/* 3DB81C E00E03BC 461C0002 */  mul.s     $f0, $f0, $f28
/* 3DB820 E00E03C0 00000000 */  nop
/* 3DB824 E00E03C4 46000021 */  cvt.d.s   $f0, $f0
/* 3DB828 E00E03C8 46340002 */  mul.d     $f0, $f0, $f20
/* 3DB82C E00E03CC 00000000 */  nop
/* 3DB830 E00E03D0 24040014 */  addiu     $a0, $zero, 0x14
/* 3DB834 E00E03D4 AE000000 */  sw        $zero, 0x0($s0)
/* 3DB838 E00E03D8 46200020 */  cvt.s.d   $f0, $f0
/* 3DB83C E00E03DC 0C080138 */  jal       shim_rand_int
/* 3DB840 E00E03E0 E600FFFC */   swc1     $f0, -0x4($s0)
/* 3DB844 E00E03E4 2442FFF6 */  addiu     $v0, $v0, -0xA
/* 3DB848 E00E03E8 44820000 */  mtc1      $v0, $f0
/* 3DB84C E00E03EC 00000000 */  nop
/* 3DB850 E00E03F0 46800020 */  cvt.s.w   $f0, $f0
/* 3DB854 E00E03F4 46000021 */  cvt.d.s   $f0, $f0
/* 3DB858 E00E03F8 46340002 */  mul.d     $f0, $f0, $f20
/* 3DB85C E00E03FC 00000000 */  nop
/* 3DB860 E00E0400 2404001E */  addiu     $a0, $zero, 0x1E
/* 3DB864 E00E0404 46200020 */  cvt.s.d   $f0, $f0
/* 3DB868 E00E0408 0C080138 */  jal       shim_rand_int
/* 3DB86C E00E040C E6000004 */   swc1     $f0, 0x4($s0)
/* 3DB870 E00E0410 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3DB874 E00E0414 C7BA0010 */  lwc1      $f26, 0x10($sp)
/* 3DB878 E00E0418 44820000 */  mtc1      $v0, $f0
/* 3DB87C E00E041C 00000000 */  nop
/* 3DB880 E00E0420 46800020 */  cvt.s.w   $f0, $f0
/* 3DB884 E00E0424 461A0002 */  mul.s     $f0, $f0, $f26
/* 3DB888 E00E0428 00000000 */  nop
/* 3DB88C E00E042C 46000021 */  cvt.d.s   $f0, $f0
/* 3DB890 E00E0430 46340002 */  mul.d     $f0, $f0, $f20
/* 3DB894 E00E0434 00000000 */  nop
/* 3DB898 E00E0438 2404000F */  addiu     $a0, $zero, 0xF
/* 3DB89C E00E043C AE00000C */  sw        $zero, 0xC($s0)
/* 3DB8A0 E00E0440 46200020 */  cvt.s.d   $f0, $f0
/* 3DB8A4 E00E0444 0C080138 */  jal       shim_rand_int
/* 3DB8A8 E00E0448 E6000008 */   swc1     $f0, 0x8($s0)
/* 3DB8AC E00E044C 2404000F */  addiu     $a0, $zero, 0xF
/* 3DB8B0 E00E0450 44820000 */  mtc1      $v0, $f0
/* 3DB8B4 E00E0454 00000000 */  nop
/* 3DB8B8 E00E0458 46800020 */  cvt.s.w   $f0, $f0
/* 3DB8BC E00E045C 0C080138 */  jal       shim_rand_int
/* 3DB8C0 E00E0460 E6000010 */   swc1     $f0, 0x10($s0)
/* 3DB8C4 E00E0464 44820000 */  mtc1      $v0, $f0
/* 3DB8C8 E00E0468 00000000 */  nop
/* 3DB8CC E00E046C 46800020 */  cvt.s.w   $f0, $f0
/* 3DB8D0 E00E0470 E6000014 */  swc1      $f0, 0x14($s0)
.LE00E0474:
/* 3DB8D4 E00E0474 C610FFF8 */  lwc1      $f16, -0x8($s0)
/* 3DB8D8 E00E0478 C60A0004 */  lwc1      $f10, 0x4($s0)
/* 3DB8DC E00E047C 46105281 */  sub.s     $f10, $f10, $f16
/* 3DB8E0 E00E0480 460052A1 */  cvt.d.s   $f10, $f10
/* 3DB8E4 E00E0484 46365282 */  mul.d     $f10, $f10, $f22
/* 3DB8E8 E00E0488 00000000 */  nop
/* 3DB8EC E00E048C C60EFFFC */  lwc1      $f14, -0x4($s0)
/* 3DB8F0 E00E0490 C60C0008 */  lwc1      $f12, 0x8($s0)
/* 3DB8F4 E00E0494 460E6301 */  sub.s     $f12, $f12, $f14
/* 3DB8F8 E00E0498 46006321 */  cvt.d.s   $f12, $f12
/* 3DB8FC E00E049C 46366302 */  mul.d     $f12, $f12, $f22
/* 3DB900 E00E04A0 00000000 */  nop
/* 3DB904 E00E04A4 C6060000 */  lwc1      $f6, 0x0($s0)
/* 3DB908 E00E04A8 C608000C */  lwc1      $f8, 0xC($s0)
/* 3DB90C E00E04AC 46064201 */  sub.s     $f8, $f8, $f6
/* 3DB910 E00E04B0 46004221 */  cvt.d.s   $f8, $f8
/* 3DB914 E00E04B4 46364202 */  mul.d     $f8, $f8, $f22
/* 3DB918 E00E04B8 00000000 */  nop
/* 3DB91C E00E04BC 8E020018 */  lw        $v0, 0x18($s0)
/* 3DB920 E00E04C0 C600FFB8 */  lwc1      $f0, -0x48($s0)
/* 3DB924 E00E04C4 C612FFBC */  lwc1      $f18, -0x44($s0)
/* 3DB928 E00E04C8 00021080 */  sll       $v0, $v0, 2
/* 3DB92C E00E04CC 00531021 */  addu      $v0, $v0, $s3
/* 3DB930 E00E04D0 46008086 */  mov.s     $f2, $f16
/* 3DB934 E00E04D4 C4440000 */  lwc1      $f4, 0x0($v0)
/* 3DB938 E00E04D8 46020000 */  add.s     $f0, $f0, $f2
/* 3DB93C E00E04DC C6020010 */  lwc1      $f2, 0x10($s0)
/* 3DB940 E00E04E0 46008421 */  cvt.d.s   $f16, $f16
/* 3DB944 E00E04E4 E604FFF4 */  swc1      $f4, -0xC($s0)
/* 3DB948 E00E04E8 E600FFB8 */  swc1      $f0, -0x48($s0)
/* 3DB94C E00E04EC 46007006 */  mov.s     $f0, $f14
/* 3DB950 E00E04F0 46009480 */  add.s     $f18, $f18, $f0
/* 3DB954 E00E04F4 C604FFC0 */  lwc1      $f4, -0x40($s0)
/* 3DB958 E00E04F8 46003006 */  mov.s     $f0, $f6
/* 3DB95C E00E04FC 46002100 */  add.s     $f4, $f4, $f0
/* 3DB960 E00E0500 3C01E00E */  lui       $at, (0xE00E0AD0 >> 16)
/* 3DB964 E00E0504 D4200AD0 */  ldc1      $f0, (0xE00E0AD0 & 0xFFFF)($at)
/* 3DB968 E00E0508 460010A1 */  cvt.d.s   $f2, $f2
/* 3DB96C E00E050C 46201080 */  add.d     $f2, $f2, $f0
/* 3DB970 E00E0510 C6000014 */  lwc1      $f0, 0x14($s0)
/* 3DB974 E00E0514 460073A1 */  cvt.d.s   $f14, $f14
/* 3DB978 E00E0518 E604FFC0 */  swc1      $f4, -0x40($s0)
/* 3DB97C E00E051C 3C01E00E */  lui       $at, (0xE00E0AD8 >> 16)
/* 3DB980 E00E0520 D4240AD8 */  ldc1      $f4, (0xE00E0AD8 & 0xFFFF)($at)
/* 3DB984 E00E0524 46000021 */  cvt.d.s   $f0, $f0
/* 3DB988 E00E0528 46240000 */  add.d     $f0, $f0, $f4
/* 3DB98C E00E052C 460031A1 */  cvt.d.s   $f6, $f6
/* 3DB990 E00E0530 E612FFBC */  swc1      $f18, -0x44($s0)
/* 3DB994 E00E0534 462A8400 */  add.d     $f16, $f16, $f10
/* 3DB998 E00E0538 462010A0 */  cvt.s.d   $f2, $f2
/* 3DB99C E00E053C E6020010 */  swc1      $f2, 0x10($s0)
/* 3DB9A0 E00E0540 462C7380 */  add.d     $f14, $f14, $f12
/* 3DB9A4 E00E0544 46200020 */  cvt.s.d   $f0, $f0
/* 3DB9A8 E00E0548 E6000014 */  swc1      $f0, 0x14($s0)
/* 3DB9AC E00E054C 46283180 */  add.d     $f6, $f6, $f8
/* 3DB9B0 E00E0550 46208420 */  cvt.s.d   $f16, $f16
/* 3DB9B4 E00E0554 462073A0 */  cvt.s.d   $f14, $f14
/* 3DB9B8 E00E0558 462031A0 */  cvt.s.d   $f6, $f6
/* 3DB9BC E00E055C E610FFF8 */  swc1      $f16, -0x8($s0)
/* 3DB9C0 E00E0560 E60EFFFC */  swc1      $f14, -0x4($s0)
/* 3DB9C4 E00E0564 E6060000 */  swc1      $f6, 0x0($s0)
/* 3DB9C8 E00E0568 26310001 */  addiu     $s1, $s1, 0x1
.LE00E056C:
/* 3DB9CC E00E056C 8E420008 */  lw        $v0, 0x8($s2)
/* 3DB9D0 E00E0570 0222102A */  slt       $v0, $s1, $v0
/* 3DB9D4 E00E0574 1440FF5D */  bnez      $v0, .LE00E02EC
/* 3DB9D8 E00E0578 26100070 */   addiu    $s0, $s0, 0x70
.LE00E057C:
/* 3DB9DC E00E057C 8FBF0028 */  lw        $ra, 0x28($sp)
/* 3DB9E0 E00E0580 8FB30024 */  lw        $s3, 0x24($sp)
/* 3DB9E4 E00E0584 8FB20020 */  lw        $s2, 0x20($sp)
/* 3DB9E8 E00E0588 8FB1001C */  lw        $s1, 0x1C($sp)
/* 3DB9EC E00E058C 8FB00018 */  lw        $s0, 0x18($sp)
/* 3DB9F0 E00E0590 D7BE0058 */  ldc1      $f30, 0x58($sp)
/* 3DB9F4 E00E0594 D7BC0050 */  ldc1      $f28, 0x50($sp)
/* 3DB9F8 E00E0598 D7BA0048 */  ldc1      $f26, 0x48($sp)
/* 3DB9FC E00E059C D7B80040 */  ldc1      $f24, 0x40($sp)
/* 3DBA00 E00E05A0 D7B60038 */  ldc1      $f22, 0x38($sp)
/* 3DBA04 E00E05A4 D7B40030 */  ldc1      $f20, 0x30($sp)
/* 3DBA08 E00E05A8 03E00008 */  jr        $ra
/* 3DBA0C E00E05AC 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

void embers_update(EffectInstance* effect) {
    EmbersFXData* part = effect->data.embers;
    f32 unk_10;
    f32 unk_14;
    s32 time;
    f32 unk_68;
    f32 unk_6C;
    s32 i;

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

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

    part->lifetime++;
    if (part->lifetime > 324000) {
        part->lifetime = 256;
    }

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

    time = part->lifetime;

    if (part->timeLeft < 16) {
        part->unk_2C = part->timeLeft * 16;
    }

    if (time < 16) {
        part->unk_2C = time * 16 + 15;
    }

    unk_10 = part->unk_10;
    unk_14 = part->unk_14;
    unk_68 = part->unk_68;
    unk_6C = part->unk_6C;

    part++;
    for (i = 1; i < effect->numParts; i++, part++) {
        part->unk_64++;
        if (part->unk_64 >= 30) {
            part->unk_64 = 0;
        }

        if (part->unk_64 >= 0) {
            if (part->unk_64 == 0) {
                part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5;
                part->unk_08 = shim_rand_int(unk_14);
                part->unk_0C = 0.0f;
                part->unk_44 = (f32) (shim_rand_int(20) - 10) * 0.05;
                part->unk_48 = (shim_rand_int(40) - 1) * unk_68 * 0.05;
                part->unk_4C = 0.0f;
                part->unk_50 = (f32) (shim_rand_int(20) - 10) * 0.05;
                part->unk_54 = (shim_rand_int(30) - 1) * unk_6C * 0.05;
                part->unk_58 = 0.0f;
                part->unk_5C = shim_rand_int(15);
                part->unk_60 = shim_rand_int(15);
            }
            part->unk_40 = D_E00E0A48[part->unk_64];
            part->unk_04 += part->unk_44;
            part->unk_08 += part->unk_48;
            part->unk_0C += part->unk_4C;
            part->unk_5C += 0.1;
            part->unk_60 += 0.3;
            part->unk_44 += (part->unk_50 - part->unk_44) * 0.04;
            part->unk_48 += (part->unk_54 - part->unk_48) * 0.04;
            part->unk_4C += (part->unk_58 - part->unk_4C) * 0.04;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel smoke_burst_appendGfx
/* 35BBE4 E004E214 27BDFF30 */  addiu     $sp, $sp, -0xD0
/* 35BBE8 E004E218 0080302D */  daddu     $a2, $a0, $zero
/* 35BBEC E004E21C 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 35BBF0 E004E220 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 35BBF4 E004E224 27A40020 */  addiu     $a0, $sp, 0x20
/* 35BBF8 E004E228 AFB700BC */  sw        $s7, 0xBC($sp)
/* 35BBFC E004E22C 3C17800A */  lui       $s7, %hi(gMainGfxPos)
/* 35BC00 E004E230 26F7A66C */  addiu     $s7, $s7, %lo(gMainGfxPos)
/* 35BC04 E004E234 AFB600B8 */  sw        $s6, 0xB8($sp)
/* 35BC08 E004E238 3C160001 */  lui       $s6, (0x11630 >> 16)
/* 35BC0C E004E23C 36D61630 */  ori       $s6, $s6, (0x11630 & 0xFFFF)
/* 35BC10 E004E240 AFBF00C4 */  sw        $ra, 0xC4($sp)
/* 35BC14 E004E244 AFBE00C0 */  sw        $fp, 0xC0($sp)
/* 35BC18 E004E248 AFB500B4 */  sw        $s5, 0xB4($sp)
/* 35BC1C E004E24C AFB400B0 */  sw        $s4, 0xB0($sp)
/* 35BC20 E004E250 AFB300AC */  sw        $s3, 0xAC($sp)
/* 35BC24 E004E254 AFB200A8 */  sw        $s2, 0xA8($sp)
/* 35BC28 E004E258 AFB100A4 */  sw        $s1, 0xA4($sp)
/* 35BC2C E004E25C AFB000A0 */  sw        $s0, 0xA0($sp)
/* 35BC30 E004E260 F7B400C8 */  sdc1      $f20, 0xC8($sp)
/* 35BC34 E004E264 8EE80000 */  lw        $t0, 0x0($s7)
/* 35BC38 E004E268 8CD1000C */  lw        $s1, 0xC($a2)
/* 35BC3C E004E26C 4480A000 */  mtc1      $zero, $f20
/* 35BC40 E004E270 3C09E005 */  lui       $t1, (0xE0050000 >> 16)
/* 35BC44 E004E274 8D29E5EC */  lw        $t1, -0x1A14($t1)
/* 35BC48 E004E278 3C014380 */  lui       $at, (0x43800000 >> 16)
/* 35BC4C E004E27C 44812000 */  mtc1      $at, $f4
/* 35BC50 E004E280 0100182D */  daddu     $v1, $t0, $zero
/* 35BC54 E004E284 25080008 */  addiu     $t0, $t0, 0x8
/* 35BC58 E004E288 96220000 */  lhu       $v0, 0x0($s1)
/* 35BC5C E004E28C 4405A000 */  mfc1      $a1, $f20
/* 35BC60 E004E290 C6260020 */  lwc1      $f6, 0x20($s1)
/* 35BC64 E004E294 00021080 */  sll       $v0, $v0, 2
/* 35BC68 E004E298 3C1EE005 */  lui       $fp, (0xE0050000 >> 16)
/* 35BC6C E004E29C 03C2F021 */  addu      $fp, $fp, $v0
/* 35BC70 E004E2A0 8FDEE5E0 */  lw        $fp, -0x1A20($fp)
/* 35BC74 E004E2A4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 35BC78 E004E2A8 4600328D */  trunc.w.s $f10, $f6
/* 35BC7C E004E2AC 44145000 */  mfc1      $s4, $f10
/* 35BC80 E004E2B0 00000000 */  nop
/* 35BC84 E004E2B4 44941000 */  mtc1      $s4, $f2
/* 35BC88 E004E2B8 00000000 */  nop
/* 35BC8C E004E2BC 468010A0 */  cvt.s.w   $f2, $f2
/* 35BC90 E004E2C0 3A950007 */  xori      $s5, $s4, 0x7
/* 35BC94 E004E2C4 2EB50001 */  sltiu     $s5, $s5, 0x1
/* 35BC98 E004E2C8 46023181 */  sub.s     $f6, $f6, $f2
/* 35BC9C E004E2CC AC620000 */  sw        $v0, 0x0($v1)
/* 35BCA0 E004E2D0 AC600004 */  sw        $zero, 0x4($v1)
/* 35BCA4 E004E2D4 AD070000 */  sw        $a3, 0x0($t0)
/* 35BCA8 E004E2D8 8CC20010 */  lw        $v0, 0x10($a2)
/* 35BCAC E004E2DC 4407A000 */  mfc1      $a3, $f20
/* 35BCB0 E004E2E0 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 35BCB4 E004E2E4 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 35BCB8 E004E2E8 8C46001C */  lw        $a2, 0x1C($v0)
/* 35BCBC E004E2EC 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 35BCC0 E004E2F0 AD020008 */  sw        $v0, 0x8($t0)
/* 35BCC4 E004E2F4 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 35BCC8 E004E2F8 AD09000C */  sw        $t1, 0xC($t0)
/* 35BCCC E004E2FC 00C23021 */  addu      $a2, $a2, $v0
/* 35BCD0 E004E300 00031080 */  sll       $v0, $v1, 2
/* 35BCD4 E004E304 00431021 */  addu      $v0, $v0, $v1
/* 35BCD8 E004E308 00021080 */  sll       $v0, $v0, 2
/* 35BCDC E004E30C 00431023 */  subu      $v0, $v0, $v1
/* 35BCE0 E004E310 000218C0 */  sll       $v1, $v0, 3
/* 35BCE4 E004E314 00431021 */  addu      $v0, $v0, $v1
/* 35BCE8 E004E318 000210C0 */  sll       $v0, $v0, 3
/* 35BCEC E004E31C AD060004 */  sw        $a2, 0x4($t0)
/* 35BCF0 E004E320 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 35BCF4 E004E324 00220821 */  addu      $at, $at, $v0
/* 35BCF8 E004E328 C4281DEC */  lwc1      $f8, %lo(gCameras + 0x6C)($at)
/* 35BCFC E004E32C C6200010 */  lwc1      $f0, 0x10($s1)
/* 35BD00 E004E330 25020008 */  addiu     $v0, $t0, 0x8
/* 35BD04 E004E334 AEE80000 */  sw        $t0, 0x0($s7)
/* 35BD08 E004E338 46004207 */  neg.s     $f8, $f8
/* 35BD0C E004E33C E7A00010 */  swc1      $f0, 0x10($sp)
/* 35BD10 E004E340 C6200004 */  lwc1      $f0, 0x4($s1)
/* 35BD14 E004E344 44064000 */  mfc1      $a2, $f8
/* 35BD18 E004E348 46043182 */  mul.s     $f6, $f6, $f4
/* 35BD1C E004E34C 00000000 */  nop
/* 35BD20 E004E350 AEE20000 */  sw        $v0, 0x0($s7)
/* 35BD24 E004E354 E7A00014 */  swc1      $f0, 0x14($sp)
/* 35BD28 E004E358 C6200008 */  lwc1      $f0, 0x8($s1)
/* 35BD2C E004E35C 25080010 */  addiu     $t0, $t0, 0x10
/* 35BD30 E004E360 AEE80000 */  sw        $t0, 0x0($s7)
/* 35BD34 E004E364 E7A00018 */  swc1      $f0, 0x18($sp)
/* 35BD38 E004E368 C620000C */  lwc1      $f0, 0xC($s1)
/* 35BD3C E004E36C 4600328D */  trunc.w.s $f10, $f6
/* 35BD40 E004E370 44135000 */  mfc1      $s3, $f10
/* 35BD44 E004E374 0C080180 */  jal       shim_guPositionF
/* 35BD48 E004E378 E7A0001C */   swc1     $f0, 0x1C($sp)
/* 35BD4C E004E37C 27B00060 */  addiu     $s0, $sp, 0x60
/* 35BD50 E004E380 0200202D */  daddu     $a0, $s0, $zero
/* 35BD54 E004E384 3C0541A0 */  lui       $a1, (0x41A00000 >> 16)
/* 35BD58 E004E388 4406A000 */  mfc1      $a2, $f20
/* 35BD5C E004E38C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 35BD60 E004E390 44810000 */  mtc1      $at, $f0
/* 35BD64 E004E394 00C0382D */  daddu     $a3, $a2, $zero
/* 35BD68 E004E398 0C080104 */  jal       shim_guRotateF
/* 35BD6C E004E39C E7A00010 */   swc1     $f0, 0x10($sp)
/* 35BD70 E004E3A0 0200202D */  daddu     $a0, $s0, $zero
/* 35BD74 E004E3A4 27A50020 */  addiu     $a1, $sp, 0x20
/* 35BD78 E004E3A8 0C080114 */  jal       shim_guMtxCatF
/* 35BD7C E004E3AC 00A0302D */   daddu    $a2, $a1, $zero
/* 35BD80 E004E3B0 27A40020 */  addiu     $a0, $sp, 0x20
/* 35BD84 E004E3B4 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 35BD88 E004E3B8 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 35BD8C E004E3BC 3C12800A */  lui       $s2, %hi(gDisplayContext)
/* 35BD90 E004E3C0 2652A674 */  addiu     $s2, $s2, %lo(gDisplayContext)
/* 35BD94 E004E3C4 96050000 */  lhu       $a1, 0x0($s0)
/* 35BD98 E004E3C8 8E420000 */  lw        $v0, 0x0($s2)
/* 35BD9C E004E3CC 00052980 */  sll       $a1, $a1, 6
/* 35BDA0 E004E3D0 00B62821 */  addu      $a1, $a1, $s6
/* 35BDA4 E004E3D4 0C080118 */  jal       shim_guMtxF2L
/* 35BDA8 E004E3D8 00452821 */   addu     $a1, $v0, $a1
/* 35BDAC E004E3DC 3C07E200 */  lui       $a3, (0xE2001E01 >> 16)
/* 35BDB0 E004E3E0 34E71E01 */  ori       $a3, $a3, (0xE2001E01 & 0xFFFF)
/* 35BDB4 E004E3E4 8EE80000 */  lw        $t0, 0x0($s7)
/* 35BDB8 E004E3E8 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 35BDBC E004E3EC 0100202D */  daddu     $a0, $t0, $zero
/* 35BDC0 E004E3F0 25080008 */  addiu     $t0, $t0, 0x8
/* 35BDC4 E004E3F4 AEE80000 */  sw        $t0, 0x0($s7)
/* 35BDC8 E004E3F8 96020000 */  lhu       $v0, 0x0($s0)
/* 35BDCC E004E3FC 327300FF */  andi      $s3, $s3, 0xFF
/* 35BDD0 E004E400 AC830000 */  sw        $v1, 0x0($a0)
/* 35BDD4 E004E404 24430001 */  addiu     $v1, $v0, 0x1
/* 35BDD8 E004E408 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 35BDDC E004E40C 00021180 */  sll       $v0, $v0, 6
/* 35BDE0 E004E410 A6030000 */  sh        $v1, 0x0($s0)
/* 35BDE4 E004E414 8E430000 */  lw        $v1, 0x0($s2)
/* 35BDE8 E004E418 00561021 */  addu      $v0, $v0, $s6
/* 35BDEC E004E41C 00621821 */  addu      $v1, $v1, $v0
/* 35BDF0 E004E420 25020008 */  addiu     $v0, $t0, 0x8
/* 35BDF4 E004E424 AC830004 */  sw        $v1, 0x4($a0)
/* 35BDF8 E004E428 AEE20000 */  sw        $v0, 0x0($s7)
/* 35BDFC E004E42C 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 35BE00 E004E430 AD020000 */  sw        $v0, 0x0($t0)
/* 35BE04 E004E434 92230024 */  lbu       $v1, 0x24($s1)
/* 35BE08 E004E438 92240025 */  lbu       $a0, 0x25($s1)
/* 35BE0C E004E43C 92250026 */  lbu       $a1, 0x26($s1)
/* 35BE10 E004E440 92260027 */  lbu       $a2, 0x27($s1)
/* 35BE14 E004E444 25020010 */  addiu     $v0, $t0, 0x10
/* 35BE18 E004E448 AEE20000 */  sw        $v0, 0x0($s7)
/* 35BE1C E004E44C 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 35BE20 E004E450 AD020008 */  sw        $v0, 0x8($t0)
/* 35BE24 E004E454 25020018 */  addiu     $v0, $t0, 0x18
/* 35BE28 E004E458 AD13000C */  sw        $s3, 0xC($t0)
/* 35BE2C E004E45C AEE20000 */  sw        $v0, 0x0($s7)
/* 35BE30 E004E460 24020003 */  addiu     $v0, $zero, 0x3
/* 35BE34 E004E464 AD020014 */  sw        $v0, 0x14($t0)
/* 35BE38 E004E468 25020020 */  addiu     $v0, $t0, 0x20
/* 35BE3C E004E46C AD070010 */  sw        $a3, 0x10($t0)
/* 35BE40 E004E470 AEE20000 */  sw        $v0, 0x0($s7)
/* 35BE44 E004E474 001411C0 */  sll       $v0, $s4, 7
/* 35BE48 E004E478 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BE4C E004E47C 00021300 */  sll       $v0, $v0, 12
/* 35BE50 E004E480 3C07F200 */  lui       $a3, (0xF2000080 >> 16)
/* 35BE54 E004E484 00471025 */  or        $v0, $v0, $a3
/* 35BE58 E004E488 0014A140 */  sll       $s4, $s4, 5
/* 35BE5C E004E48C AD020018 */  sw        $v0, 0x18($t0)
/* 35BE60 E004E490 2682001F */  addiu     $v0, $s4, 0x1F
/* 35BE64 E004E494 00021080 */  sll       $v0, $v0, 2
/* 35BE68 E004E498 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BE6C E004E49C 00021300 */  sll       $v0, $v0, 12
/* 35BE70 E004E4A0 3442007C */  ori       $v0, $v0, 0x7C
/* 35BE74 E004E4A4 AD02001C */  sw        $v0, 0x1C($t0)
/* 35BE78 E004E4A8 00031E00 */  sll       $v1, $v1, 24
/* 35BE7C E004E4AC 00042400 */  sll       $a0, $a0, 16
/* 35BE80 E004E4B0 00641825 */  or        $v1, $v1, $a0
/* 35BE84 E004E4B4 00052A00 */  sll       $a1, $a1, 8
/* 35BE88 E004E4B8 00651825 */  or        $v1, $v1, $a1
/* 35BE8C E004E4BC 00661825 */  or        $v1, $v1, $a2
/* 35BE90 E004E4C0 26850020 */  addiu     $a1, $s4, 0x20
/* 35BE94 E004E4C4 12A00012 */  beqz      $s5, .LE004E510
/* 35BE98 E004E4C8 AD030004 */   sw       $v1, 0x4($t0)
/* 35BE9C E004E4CC 00E0182D */  daddu     $v1, $a3, $zero
/* 35BEA0 E004E4D0 34630080 */  ori       $v1, $v1, (0xF2000080 & 0xFFFF)
/* 35BEA4 E004E4D4 3C040100 */  lui       $a0, (0x10000FC >> 16)
/* 35BEA8 E004E4D8 348400FC */  ori       $a0, $a0, (0x10000FC & 0xFFFF)
/* 35BEAC E004E4DC 25020028 */  addiu     $v0, $t0, 0x28
/* 35BEB0 E004E4E0 AEE20000 */  sw        $v0, 0x0($s7)
/* 35BEB4 E004E4E4 00051080 */  sll       $v0, $a1, 2
/* 35BEB8 E004E4E8 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BEBC E004E4EC 00021300 */  sll       $v0, $v0, 12
/* 35BEC0 E004E4F0 00431025 */  or        $v0, $v0, $v1
/* 35BEC4 E004E4F4 AD020020 */  sw        $v0, 0x20($t0)
/* 35BEC8 E004E4F8 2682003F */  addiu     $v0, $s4, 0x3F
/* 35BECC E004E4FC 00021080 */  sll       $v0, $v0, 2
/* 35BED0 E004E500 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BED4 E004E504 00021300 */  sll       $v0, $v0, 12
/* 35BED8 E004E508 08013952 */  j         .LE004E548
/* 35BEDC E004E50C 00441025 */   or       $v0, $v0, $a0
.LE004E510:
/* 35BEE0 E004E510 3C030100 */  lui       $v1, (0x100007C >> 16)
/* 35BEE4 E004E514 3463007C */  ori       $v1, $v1, (0x100007C & 0xFFFF)
/* 35BEE8 E004E518 25020028 */  addiu     $v0, $t0, 0x28
/* 35BEEC E004E51C AEE20000 */  sw        $v0, 0x0($s7)
/* 35BEF0 E004E520 00051080 */  sll       $v0, $a1, 2
/* 35BEF4 E004E524 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BEF8 E004E528 00021300 */  sll       $v0, $v0, 12
/* 35BEFC E004E52C 00471025 */  or        $v0, $v0, $a3
/* 35BF00 E004E530 AD020020 */  sw        $v0, 0x20($t0)
/* 35BF04 E004E534 2682003F */  addiu     $v0, $s4, 0x3F
/* 35BF08 E004E538 00021080 */  sll       $v0, $v0, 2
/* 35BF0C E004E53C 30420FFF */  andi      $v0, $v0, 0xFFF
/* 35BF10 E004E540 00021300 */  sll       $v0, $v0, 12
/* 35BF14 E004E544 00431025 */  or        $v0, $v0, $v1
.LE004E548:
/* 35BF18 E004E548 AD020024 */  sw        $v0, 0x24($t0)
/* 35BF1C E004E54C 3C06E200 */  lui       $a2, (0xE2001E01 >> 16)
/* 35BF20 E004E550 34C61E01 */  ori       $a2, $a2, (0xE2001E01 & 0xFFFF)
/* 35BF24 E004E554 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 35BF28 E004E558 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 35BF2C E004E55C 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 35BF30 E004E560 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 35BF34 E004E564 8C820000 */  lw        $v0, 0x0($a0)
/* 35BF38 E004E568 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* 35BF3C E004E56C 0040282D */  daddu     $a1, $v0, $zero
/* 35BF40 E004E570 24420008 */  addiu     $v0, $v0, 0x8
/* 35BF44 E004E574 AC820000 */  sw        $v0, 0x0($a0)
/* 35BF48 E004E578 ACA30000 */  sw        $v1, 0x0($a1)
/* 35BF4C E004E57C 24430008 */  addiu     $v1, $v0, 0x8
/* 35BF50 E004E580 ACBE0004 */  sw        $fp, 0x4($a1)
/* 35BF54 E004E584 AC830000 */  sw        $v1, 0x0($a0)
/* 35BF58 E004E588 24430010 */  addiu     $v1, $v0, 0x10
/* 35BF5C E004E58C AC460000 */  sw        $a2, 0x0($v0)
/* 35BF60 E004E590 AC400004 */  sw        $zero, 0x4($v0)
/* 35BF64 E004E594 AC830000 */  sw        $v1, 0x0($a0)
/* 35BF68 E004E598 24030040 */  addiu     $v1, $zero, 0x40
/* 35BF6C E004E59C AC470008 */  sw        $a3, 0x8($v0)
/* 35BF70 E004E5A0 AC43000C */  sw        $v1, 0xC($v0)
/* 35BF74 E004E5A4 8FBF00C4 */  lw        $ra, 0xC4($sp)
/* 35BF78 E004E5A8 8FBE00C0 */  lw        $fp, 0xC0($sp)
/* 35BF7C E004E5AC 8FB700BC */  lw        $s7, 0xBC($sp)
/* 35BF80 E004E5B0 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 35BF84 E004E5B4 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 35BF88 E004E5B8 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 35BF8C E004E5BC 8FB300AC */  lw        $s3, 0xAC($sp)
/* 35BF90 E004E5C0 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 35BF94 E004E5C4 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 35BF98 E004E5C8 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 35BF9C E004E5CC D7B400C8 */  ldc1      $f20, 0xC8($sp)
/* 35BFA0 E004E5D0 03E00008 */  jr        $ra
/* 35BFA4 E004E5D4 27BD00D0 */   addiu    $sp, $sp, 0xD0
/* 35BFA8 E004E5D8 00000000 */  nop
/* 35BFAC E004E5DC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void smoke_burst_appendGfx(void* effect) {
    SmokeBurstFXData* data = ((EffectInstance*)effect)->data.smokeBurst;
    s32 unk_20_s32 = data->unk_20;
    s32 envAlpha = (data->unk_20 - unk_20_s32) * 256.0f;
    s32 cond = (unk_20_s32 == 7);
    s32 temp_a1;
    Gfx* dlist = D_E004E5E0[data->unk_00];
    Gfx* dlist2 = D_E004E5EC[0];
    Matrix4f sp20;
    Matrix4f sp60;

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

    shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f);
    shim_guMtxCatF(sp60, sp20, sp20);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->rgba.r, data->rgba.g, data->rgba.b, data->rgba.a);
    gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, envAlpha);
    gDPSetAlphaCompare(gMainGfxPos++, G_AC_DITHER);
    gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
        (unk_20_s32 * 32     ) * 4, 0,
        (unk_20_s32 * 32 + 31) * 4, 31 * 4);

    temp_a1 = unk_20_s32 * 32 + 32;

    if (cond) {
        gDPSetTileSize(gMainGfxPos++, 1,
            (temp_a1     ) * 4, 32 * 4,
            (temp_a1 + 31) * 4, 63 * 4);
    } else {
        gDPSetTileSize(gMainGfxPos++, 1,
            (temp_a1     ) * 4, 0,
            (temp_a1 + 31) * 4, 31 * 4);
    }

    gSPDisplayList(gMainGfxPos++, dlist);
    gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel something_rotating_appendGfx
/* 402EC4 E0116884 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 402EC8 E0116888 AFB7002C */  sw        $s7, 0x2C($sp)
/* 402ECC E011688C 0080B82D */  daddu     $s7, $a0, $zero
/* 402ED0 E0116890 3C05DB06 */  lui       $a1, (0xDB060024 >> 16)
/* 402ED4 E0116894 34A50024 */  ori       $a1, $a1, (0xDB060024 & 0xFFFF)
/* 402ED8 E0116898 AFB3001C */  sw        $s3, 0x1C($sp)
/* 402EDC E011689C 24130001 */  addiu     $s3, $zero, 0x1
/* 402EE0 E01168A0 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 402EE4 E01168A4 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 402EE8 E01168A8 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* 402EEC E01168AC AFBF0034 */  sw        $ra, 0x34($sp)
/* 402EF0 E01168B0 AFBE0030 */  sw        $fp, 0x30($sp)
/* 402EF4 E01168B4 AFB60028 */  sw        $s6, 0x28($sp)
/* 402EF8 E01168B8 AFB50024 */  sw        $s5, 0x24($sp)
/* 402EFC E01168BC AFB40020 */  sw        $s4, 0x20($sp)
/* 402F00 E01168C0 AFB20018 */  sw        $s2, 0x18($sp)
/* 402F04 E01168C4 AFB10014 */  sw        $s1, 0x14($sp)
/* 402F08 E01168C8 AFB00010 */  sw        $s0, 0x10($sp)
/* 402F0C E01168CC F7B40038 */  sdc1      $f20, 0x38($sp)
/* 402F10 E01168D0 8CC20000 */  lw        $v0, 0x0($a2)
/* 402F14 E01168D4 8EF2000C */  lw        $s2, 0xC($s7)
/* 402F18 E01168D8 0040202D */  daddu     $a0, $v0, $zero
/* 402F1C E01168DC 24420008 */  addiu     $v0, $v0, 0x8
/* 402F20 E01168E0 8E5E0014 */  lw        $fp, 0x14($s2)
/* 402F24 E01168E4 26520030 */  addiu     $s2, $s2, 0x30
/* 402F28 E01168E8 ACC20000 */  sw        $v0, 0x0($a2)
/* 402F2C E01168EC AC830000 */  sw        $v1, 0x0($a0)
/* 402F30 E01168F0 24430008 */  addiu     $v1, $v0, 0x8
/* 402F34 E01168F4 AC800004 */  sw        $zero, 0x4($a0)
/* 402F38 E01168F8 ACC30000 */  sw        $v1, 0x0($a2)
/* 402F3C E01168FC AC450000 */  sw        $a1, 0x0($v0)
/* 402F40 E0116900 8EE40010 */  lw        $a0, 0x10($s7)
/* 402F44 E0116904 24430010 */  addiu     $v1, $v0, 0x10
/* 402F48 E0116908 ACC30000 */  sw        $v1, 0x0($a2)
/* 402F4C E011690C 8C84001C */  lw        $a0, 0x1C($a0)
/* 402F50 E0116910 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* 402F54 E0116914 AC430008 */  sw        $v1, 0x8($v0)
/* 402F58 E0116918 3C030900 */  lui       $v1, %hi(D_090042E0_411570)
/* 402F5C E011691C 246342E0 */  addiu     $v1, $v1, %lo(D_090042E0_411570)
/* 402F60 E0116920 AC43000C */  sw        $v1, 0xC($v0)
/* 402F64 E0116924 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 402F68 E0116928 AC430010 */  sw        $v1, 0x10($v0)
/* 402F6C E011692C 240300FF */  addiu     $v1, $zero, 0xFF
/* 402F70 E0116930 AC430014 */  sw        $v1, 0x14($v0)
/* 402F74 E0116934 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 402F78 E0116938 00832021 */  addu      $a0, $a0, $v1
/* 402F7C E011693C AC440004 */  sw        $a0, 0x4($v0)
/* 402F80 E0116940 8EE30008 */  lw        $v1, 0x8($s7)
/* 402F84 E0116944 24420018 */  addiu     $v0, $v0, 0x18
/* 402F88 E0116948 0263182A */  slt       $v1, $s3, $v1
/* 402F8C E011694C 106000B5 */  beqz      $v1, .LE0116C24
/* 402F90 E0116950 ACC20000 */   sw       $v0, 0x0($a2)
/* 402F94 E0116954 00C0882D */  daddu     $s1, $a2, $zero
/* 402F98 E0116958 3C16FB00 */  lui       $s6, (0xFB000000 >> 16)
/* 402F9C E011695C 3C14DE00 */  lui       $s4, (0xDE000000 >> 16)
/* 402FA0 E0116960 3C013F50 */  lui       $at, (0x3F500000 >> 16)
/* 402FA4 E0116964 4481A800 */  mtc1      $at, $f21
/* 402FA8 E0116968 4480A000 */  mtc1      $zero, $f20
/* 402FAC E011696C 3C15F200 */  lui       $s5, (0xF2000000 >> 16)
/* 402FB0 E0116970 26500025 */  addiu     $s0, $s2, 0x25
.LE0116974:
/* 402FB4 E0116974 92030004 */  lbu       $v1, 0x4($s0)
/* 402FB8 E0116978 24020005 */  addiu     $v0, $zero, 0x5
/* 402FBC E011697C 506200A4 */  beql      $v1, $v0, .LE0116C10
/* 402FC0 E0116980 26730001 */   addiu    $s3, $s3, 0x1
/* 402FC4 E0116984 24040001 */  addiu     $a0, $zero, 0x1
/* 402FC8 E0116988 0C0459BA */  jal       func_E01166E8
/* 402FCC E011698C 0240282D */   daddu    $a1, $s2, $zero
/* 402FD0 E0116990 9203FFFF */  lbu       $v1, -0x1($s0)
/* 402FD4 E0116994 240200FF */  addiu     $v0, $zero, 0xFF
/* 402FD8 E0116998 1062006E */  beq       $v1, $v0, .LE0116B54
/* 402FDC E011699C 3C02FA00 */   lui      $v0, (0xFA000000 >> 16)
/* 402FE0 E01169A0 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 402FE4 E01169A4 44810000 */  mtc1      $at, $f0
/* 402FE8 E01169A8 449E1000 */  mtc1      $fp, $f2
/* 402FEC E01169AC 00000000 */  nop
/* 402FF0 E01169B0 468010A0 */  cvt.s.w   $f2, $f2
/* 402FF4 E01169B4 46001082 */  mul.s     $f2, $f2, $f0
/* 402FF8 E01169B8 00000000 */  nop
/* 402FFC E01169BC 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* 403000 E01169C0 44813000 */  mtc1      $at, $f6
/* 403004 E01169C4 00000000 */  nop
/* 403008 E01169C8 46061182 */  mul.s     $f6, $f2, $f6
/* 40300C E01169CC 00000000 */  nop
/* 403010 E01169D0 460031A1 */  cvt.d.s   $f6, $f6
/* 403014 E01169D4 46343182 */  mul.d     $f6, $f6, $f20
/* 403018 E01169D8 00000000 */  nop
/* 40301C E01169DC 8E260000 */  lw        $a2, 0x0($s1)
/* 403020 E01169E0 3C014220 */  lui       $at, (0x42200000 >> 16)
/* 403024 E01169E4 44812000 */  mtc1      $at, $f4
/* 403028 E01169E8 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 40302C E01169EC 44814000 */  mtc1      $at, $f8
/* 403030 E01169F0 00C0202D */  daddu     $a0, $a2, $zero
/* 403034 E01169F4 24C60008 */  addiu     $a2, $a2, 0x8
/* 403038 E01169F8 AE260000 */  sw        $a2, 0x0($s1)
/* 40303C E01169FC AC820000 */  sw        $v0, 0x0($a0)
/* 403040 E0116A00 46041102 */  mul.s     $f4, $f2, $f4
/* 403044 E0116A04 00000000 */  nop
/* 403048 E0116A08 9203FFFF */  lbu       $v1, -0x1($s0)
/* 40304C E0116A0C 3C014348 */  lui       $at, (0x43480000 >> 16)
/* 403050 E0116A10 44810000 */  mtc1      $at, $f0
/* 403054 E0116A14 24C20008 */  addiu     $v0, $a2, 0x8
/* 403058 E0116A18 AE220000 */  sw        $v0, 0x0($s1)
/* 40305C E0116A1C 46002121 */  cvt.d.s   $f4, $f4
/* 403060 E0116A20 46342102 */  mul.d     $f4, $f4, $f20
/* 403064 E0116A24 00000000 */  nop
/* 403068 E0116A28 AC830004 */  sw        $v1, 0x4($a0)
/* 40306C E0116A2C ACD60000 */  sw        $s6, 0x0($a2)
/* 403070 E0116A30 92030001 */  lbu       $v1, 0x1($s0)
/* 403074 E0116A34 92040002 */  lbu       $a0, 0x2($s0)
/* 403078 E0116A38 92050003 */  lbu       $a1, 0x3($s0)
/* 40307C E0116A3C 24C20010 */  addiu     $v0, $a2, 0x10
/* 403080 E0116A40 AE220000 */  sw        $v0, 0x0($s1)
/* 403084 E0116A44 46001002 */  mul.s     $f0, $f2, $f0
/* 403088 E0116A48 00000000 */  nop
/* 40308C E0116A4C 24C20018 */  addiu     $v0, $a2, 0x18
/* 403090 E0116A50 ACD40008 */  sw        $s4, 0x8($a2)
/* 403094 E0116A54 AE220000 */  sw        $v0, 0x0($s1)
/* 403098 E0116A58 00031E00 */  sll       $v1, $v1, 24
/* 40309C E0116A5C 46000021 */  cvt.d.s   $f0, $f0
/* 4030A0 E0116A60 46340002 */  mul.d     $f0, $f0, $f20
/* 4030A4 E0116A64 00000000 */  nop
/* 4030A8 E0116A68 00042400 */  sll       $a0, $a0, 16
/* 4030AC E0116A6C 00641825 */  or        $v1, $v1, $a0
/* 4030B0 E0116A70 00052A00 */  sll       $a1, $a1, 8
/* 4030B4 E0116A74 00651825 */  or        $v1, $v1, $a1
/* 4030B8 E0116A78 34630078 */  ori       $v1, $v1, 0x78
/* 4030BC E0116A7C ACC30004 */  sw        $v1, 0x4($a2)
/* 4030C0 E0116A80 3C03E011 */  lui       $v1, (0xE0116C6C >> 16)
/* 4030C4 E0116A84 8C636C6C */  lw        $v1, (0xE0116C6C & 0xFFFF)($v1)
/* 4030C8 E0116A88 46081082 */  mul.s     $f2, $f2, $f8
/* 4030CC E0116A8C 00000000 */  nop
/* 4030D0 E0116A90 24C20020 */  addiu     $v0, $a2, 0x20
/* 4030D4 E0116A94 AE220000 */  sw        $v0, 0x0($s1)
/* 4030D8 E0116A98 ACD40020 */  sw        $s4, 0x20($a2)
/* 4030DC E0116A9C ACC3000C */  sw        $v1, 0xC($a2)
/* 4030E0 E0116AA0 460010A1 */  cvt.d.s   $f2, $f2
/* 4030E4 E0116AA4 46341082 */  mul.d     $f2, $f2, $f20
/* 4030E8 E0116AA8 00000000 */  nop
/* 4030EC E0116AAC 4620328D */  trunc.w.d $f10, $f6
/* 4030F0 E0116AB0 44075000 */  mfc1      $a3, $f10
/* 4030F4 E0116AB4 4620228D */  trunc.w.d $f10, $f4
/* 4030F8 E0116AB8 44085000 */  mfc1      $t0, $f10
/* 4030FC E0116ABC 30E40FFF */  andi      $a0, $a3, 0xFFF
/* 403100 E0116AC0 24E200FC */  addiu     $v0, $a3, 0xFC
/* 403104 E0116AC4 4620028D */  trunc.w.d $f10, $f0
/* 403108 E0116AC8 44075000 */  mfc1      $a3, $f10
/* 40310C E0116ACC 31030FFF */  andi      $v1, $t0, 0xFFF
/* 403110 E0116AD0 250500FC */  addiu     $a1, $t0, 0xFC
/* 403114 E0116AD4 4620128D */  trunc.w.d $f10, $f2
/* 403118 E0116AD8 44085000 */  mfc1      $t0, $f10
/* 40311C E0116ADC 00042300 */  sll       $a0, $a0, 12
/* 403120 E0116AE0 00751825 */  or        $v1, $v1, $s5
/* 403124 E0116AE4 00832025 */  or        $a0, $a0, $v1
/* 403128 E0116AE8 30420FFF */  andi      $v0, $v0, 0xFFF
/* 40312C E0116AEC 00021300 */  sll       $v0, $v0, 12
/* 403130 E0116AF0 30A50FFF */  andi      $a1, $a1, 0xFFF
/* 403134 E0116AF4 00451025 */  or        $v0, $v0, $a1
/* 403138 E0116AF8 30E30FFF */  andi      $v1, $a3, 0xFFF
/* 40313C E0116AFC 00031B00 */  sll       $v1, $v1, 12
/* 403140 E0116B00 ACC20014 */  sw        $v0, 0x14($a2)
/* 403144 E0116B04 31020FFF */  andi      $v0, $t0, 0xFFF
/* 403148 E0116B08 00551025 */  or        $v0, $v0, $s5
/* 40314C E0116B0C 00621825 */  or        $v1, $v1, $v0
/* 403150 E0116B10 ACC30018 */  sw        $v1, 0x18($a2)
/* 403154 E0116B14 24E300FC */  addiu     $v1, $a3, 0xFC
/* 403158 E0116B18 30630FFF */  andi      $v1, $v1, 0xFFF
/* 40315C E0116B1C 00031B00 */  sll       $v1, $v1, 12
/* 403160 E0116B20 250200FC */  addiu     $v0, $t0, 0xFC
/* 403164 E0116B24 30420FFF */  andi      $v0, $v0, 0xFFF
/* 403168 E0116B28 ACC40010 */  sw        $a0, 0x10($a2)
/* 40316C E0116B2C 3C040100 */  lui       $a0, (0x1000000 >> 16)
/* 403170 E0116B30 00441025 */  or        $v0, $v0, $a0
/* 403174 E0116B34 00621825 */  or        $v1, $v1, $v0
/* 403178 E0116B38 ACC3001C */  sw        $v1, 0x1C($a2)
/* 40317C E0116B3C 3C03E011 */  lui       $v1, (0xE0116C64 >> 16)
/* 403180 E0116B40 8C636C64 */  lw        $v1, (0xE0116C64 & 0xFFFF)($v1)
/* 403184 E0116B44 24C20028 */  addiu     $v0, $a2, 0x28
/* 403188 E0116B48 AE220000 */  sw        $v0, 0x0($s1)
/* 40318C E0116B4C 08045AFA */  j         .LE0116BE8
/* 403190 E0116B50 ACC30024 */   sw       $v1, 0x24($a2)
.LE0116B54:
/* 403194 E0116B54 8E240000 */  lw        $a0, 0x0($s1)
/* 403198 E0116B58 0080282D */  daddu     $a1, $a0, $zero
/* 40319C E0116B5C 24840008 */  addiu     $a0, $a0, 0x8
/* 4031A0 E0116B60 AE240000 */  sw        $a0, 0x0($s1)
/* 4031A4 E0116B64 ACB40000 */  sw        $s4, 0x0($a1)
/* 4031A8 E0116B68 3C03E011 */  lui       $v1, (0xE0116C68 >> 16)
/* 4031AC E0116B6C 8C636C68 */  lw        $v1, (0xE0116C68 & 0xFFFF)($v1)
/* 4031B0 E0116B70 24820008 */  addiu     $v0, $a0, 0x8
/* 4031B4 E0116B74 AE220000 */  sw        $v0, 0x0($s1)
/* 4031B8 E0116B78 ACA30004 */  sw        $v1, 0x4($a1)
/* 4031BC E0116B7C AC960000 */  sw        $s6, 0x0($a0)
/* 4031C0 E0116B80 92020001 */  lbu       $v0, 0x1($s0)
/* 4031C4 E0116B84 92030002 */  lbu       $v1, 0x2($s0)
/* 4031C8 E0116B88 92050003 */  lbu       $a1, 0x3($s0)
/* 4031CC E0116B8C 92060000 */  lbu       $a2, 0x0($s0)
/* 4031D0 E0116B90 AC940008 */  sw        $s4, 0x8($a0)
/* 4031D4 E0116B94 00021600 */  sll       $v0, $v0, 24
/* 4031D8 E0116B98 00031C00 */  sll       $v1, $v1, 16
/* 4031DC E0116B9C 00431025 */  or        $v0, $v0, $v1
/* 4031E0 E0116BA0 00052A00 */  sll       $a1, $a1, 8
/* 4031E4 E0116BA4 00451025 */  or        $v0, $v0, $a1
/* 4031E8 E0116BA8 00461025 */  or        $v0, $v0, $a2
/* 4031EC E0116BAC AC820004 */  sw        $v0, 0x4($a0)
/* 4031F0 E0116BB0 2662FFFF */  addiu     $v0, $s3, -0x1
/* 4031F4 E0116BB4 00021080 */  sll       $v0, $v0, 2
/* 4031F8 E0116BB8 3C03E011 */  lui       $v1, (0xE0116C70 >> 16)
/* 4031FC E0116BBC 00621821 */  addu      $v1, $v1, $v0
/* 403200 E0116BC0 8C636C70 */  lw        $v1, (0xE0116C70 & 0xFFFF)($v1)
/* 403204 E0116BC4 24820010 */  addiu     $v0, $a0, 0x10
/* 403208 E0116BC8 AE220000 */  sw        $v0, 0x0($s1)
/* 40320C E0116BCC AC940010 */  sw        $s4, 0x10($a0)
/* 403210 E0116BD0 AC83000C */  sw        $v1, 0xC($a0)
/* 403214 E0116BD4 3C03E011 */  lui       $v1, (0xE0116C60 >> 16)
/* 403218 E0116BD8 8C636C60 */  lw        $v1, (0xE0116C60 & 0xFFFF)($v1)
/* 40321C E0116BDC 24820018 */  addiu     $v0, $a0, 0x18
/* 403220 E0116BE0 AE220000 */  sw        $v0, 0x0($s1)
/* 403224 E0116BE4 AC830014 */  sw        $v1, 0x14($a0)
.LE0116BE8:
/* 403228 E0116BE8 3C04D838 */  lui       $a0, (0xD8380002 >> 16)
/* 40322C E0116BEC 8E220000 */  lw        $v0, 0x0($s1)
/* 403230 E0116BF0 34840002 */  ori       $a0, $a0, (0xD8380002 & 0xFFFF)
/* 403234 E0116BF4 0040182D */  daddu     $v1, $v0, $zero
/* 403238 E0116BF8 24420008 */  addiu     $v0, $v0, 0x8
/* 40323C E0116BFC AE220000 */  sw        $v0, 0x0($s1)
/* 403240 E0116C00 24020040 */  addiu     $v0, $zero, 0x40
/* 403244 E0116C04 AC640000 */  sw        $a0, 0x0($v1)
/* 403248 E0116C08 AC620004 */  sw        $v0, 0x4($v1)
/* 40324C E0116C0C 26730001 */  addiu     $s3, $s3, 0x1
.LE0116C10:
/* 403250 E0116C10 26100030 */  addiu     $s0, $s0, 0x30
/* 403254 E0116C14 8EE20008 */  lw        $v0, 0x8($s7)
/* 403258 E0116C18 0262102A */  slt       $v0, $s3, $v0
/* 40325C E0116C1C 1440FF55 */  bnez      $v0, .LE0116974
/* 403260 E0116C20 26520030 */   addiu    $s2, $s2, 0x30
.LE0116C24:
/* 403264 E0116C24 8FBF0034 */  lw        $ra, 0x34($sp)
/* 403268 E0116C28 8FBE0030 */  lw        $fp, 0x30($sp)
/* 40326C E0116C2C 8FB7002C */  lw        $s7, 0x2C($sp)
/* 403270 E0116C30 8FB60028 */  lw        $s6, 0x28($sp)
/* 403274 E0116C34 8FB50024 */  lw        $s5, 0x24($sp)
/* 403278 E0116C38 8FB40020 */  lw        $s4, 0x20($sp)
/* 40327C E0116C3C 8FB3001C */  lw        $s3, 0x1C($sp)
/* 403280 E0116C40 8FB20018 */  lw        $s2, 0x18($sp)
/* 403284 E0116C44 8FB10014 */  lw        $s1, 0x14($sp)
/* 403288 E0116C48 8FB00010 */  lw        $s0, 0x10($sp)
/* 40328C E0116C4C D7B40038 */  ldc1      $f20, 0x38($sp)
/* 403290 E0116C50 03E00008 */  jr        $ra
/* 403294 E0116C54 27BD0040 */   addiu    $sp, $sp, 0x40
/* 403298 E0116C58 00000000 */  nop
/* 40329C E0116C5C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void something_rotating_appendGfx(void* effect) {
    SomethingRotatingFXData* data = ((EffectInstance*)effect)->data.somethingRotating;
    s32 unk_14 = data->unk_14;
    s32 l, t;
    s32 i;

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

    gSPDisplayList(gMainGfxPos++, D_090042E0_3FE790);
    gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, 255);

    data++;
    for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) {
        if (data->state != 5) {
            func_E01166E8(1, data);
            if (data->primAlpha != 255) {
                gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, data->primAlpha);
                gDPSetEnvColor(gMainGfxPos++, data->env.r, data->env.g, data->env.b, 0x78);
                gSPDisplayList(gMainGfxPos++, D_E0116C6C[0]);

                l = ((unk_14 * 4.0f) * 100.0f) * (1.0 / 1024);
                t = ((unk_14 * 4.0f) * 40.0f) * (1.0 / 1024);
                gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, l, t, l + 0xFC, t + 0xFC);

                l = ((unk_14 * 4.0f) * 200.0f) * (1.0 / 1024);
                t = ((unk_14 * 4.0f) * 90.0f) * (1.0 / 1024);
                gDPSetTileSize(gMainGfxPos++, 1, l, t, l + 0xFC, t + 0xFC);
                gSPDisplayList(gMainGfxPos++, D_E0116C64[0]);
            } else {
                gSPDisplayList(gMainGfxPos++, D_E0116C68[0]);
                gDPSetEnvColor(gMainGfxPos++, data->env.r, data->env.g, data->env.b, data->unk_25);
                gSPDisplayList(gMainGfxPos++, D_E0116C70[i - 1]);
                gSPDisplayList(gMainGfxPos++, D_E0116C60[0]);
            }
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel JumpPartTo
/* 1A8DC4 8027A4E4 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 1A8DC8 8027A4E8 AFB30024 */  sw        $s3, 0x24($sp)
/* 1A8DCC 8027A4EC 0080982D */  daddu     $s3, $a0, $zero
/* 1A8DD0 8027A4F0 AFBF0028 */  sw        $ra, 0x28($sp)
/* 1A8DD4 8027A4F4 AFB20020 */  sw        $s2, 0x20($sp)
/* 1A8DD8 8027A4F8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1A8DDC 8027A4FC AFB00018 */  sw        $s0, 0x18($sp)
/* 1A8DE0 8027A500 F7BE0058 */  sdc1      $f30, 0x58($sp)
/* 1A8DE4 8027A504 F7BC0050 */  sdc1      $f28, 0x50($sp)
/* 1A8DE8 8027A508 F7BA0048 */  sdc1      $f26, 0x48($sp)
/* 1A8DEC 8027A50C F7B80040 */  sdc1      $f24, 0x40($sp)
/* 1A8DF0 8027A510 F7B60038 */  sdc1      $f22, 0x38($sp)
/* 1A8DF4 8027A514 F7B40030 */  sdc1      $f20, 0x30($sp)
/* 1A8DF8 8027A518 8E72000C */  lw        $s2, 0xC($s3)
/* 1A8DFC 8027A51C 54A00001 */  bnel      $a1, $zero, .L8027A524
/* 1A8E00 8027A520 AE600070 */   sw       $zero, 0x70($s3)
.L8027A524:
/* 1A8E04 8027A524 8E620070 */  lw        $v0, 0x70($s3)
/* 1A8E08 8027A528 14400093 */  bnez      $v0, .L8027A778
/* 1A8E0C 8027A52C 00000000 */   nop
/* 1A8E10 8027A530 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8E14 8027A534 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8E18 8027A538 0C0B1EAF */  jal       evt_get_variable
/* 1A8E1C 8027A53C 0260202D */   daddu    $a0, $s3, $zero
/* 1A8E20 8027A540 0040802D */  daddu     $s0, $v0, $zero
/* 1A8E24 8027A544 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 1A8E28 8027A548 16020002 */  bne       $s0, $v0, .L8027A554
/* 1A8E2C 8027A54C 00000000 */   nop
/* 1A8E30 8027A550 8E700148 */  lw        $s0, 0x148($s3)
.L8027A554:
/* 1A8E34 8027A554 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8E38 8027A558 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8E3C 8027A55C 0C0B1EAF */  jal       evt_get_variable
/* 1A8E40 8027A560 0260202D */   daddu    $a0, $s3, $zero
/* 1A8E44 8027A564 0200202D */  daddu     $a0, $s0, $zero
/* 1A8E48 8027A568 0C09A75B */  jal       get_actor
/* 1A8E4C 8027A56C 0040882D */   daddu    $s1, $v0, $zero
/* 1A8E50 8027A570 0040802D */  daddu     $s0, $v0, $zero
/* 1A8E54 8027A574 0200202D */  daddu     $a0, $s0, $zero
/* 1A8E58 8027A578 0C099117 */  jal       get_actor_part
/* 1A8E5C 8027A57C 0220282D */   daddu    $a1, $s1, $zero
/* 1A8E60 8027A580 0040882D */  daddu     $s1, $v0, $zero
/* 1A8E64 8027A584 AE700074 */  sw        $s0, 0x74($s3)
/* 1A8E68 8027A588 AE710078 */  sw        $s1, 0x78($s3)
/* 1A8E6C 8027A58C 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8E70 8027A590 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8E74 8027A594 8E300010 */  lw        $s0, 0x10($s1)
/* 1A8E78 8027A598 0C0B1EAF */  jal       evt_get_variable
/* 1A8E7C 8027A59C 0260202D */   daddu    $a0, $s3, $zero
/* 1A8E80 8027A5A0 4482E000 */  mtc1      $v0, $f28
/* 1A8E84 8027A5A4 00000000 */  nop
/* 1A8E88 8027A5A8 4680E720 */  cvt.s.w   $f28, $f28
/* 1A8E8C 8027A5AC 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8E90 8027A5B0 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8E94 8027A5B4 0C0B1EAF */  jal       evt_get_variable
/* 1A8E98 8027A5B8 0260202D */   daddu    $a0, $s3, $zero
/* 1A8E9C 8027A5BC 4482F000 */  mtc1      $v0, $f30
/* 1A8EA0 8027A5C0 00000000 */  nop
/* 1A8EA4 8027A5C4 4680F7A0 */  cvt.s.w   $f30, $f30
/* 1A8EA8 8027A5C8 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8EAC 8027A5CC 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8EB0 8027A5D0 0C0B1EAF */  jal       evt_get_variable
/* 1A8EB4 8027A5D4 0260202D */   daddu    $a0, $s3, $zero
/* 1A8EB8 8027A5D8 44820000 */  mtc1      $v0, $f0
/* 1A8EBC 8027A5DC 00000000 */  nop
/* 1A8EC0 8027A5E0 46800020 */  cvt.s.w   $f0, $f0
/* 1A8EC4 8027A5E4 E61C000C */  swc1      $f28, 0xC($s0)
/* 1A8EC8 8027A5E8 E61E0010 */  swc1      $f30, 0x10($s0)
/* 1A8ECC 8027A5EC E6000014 */  swc1      $f0, 0x14($s0)
/* 1A8ED0 8027A5F0 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8ED4 8027A5F4 26520004 */  addiu     $s2, $s2, 0x4
/* 1A8ED8 8027A5F8 0C0B1EAF */  jal       evt_get_variable
/* 1A8EDC 8027A5FC 0260202D */   daddu    $a0, $s3, $zero
/* 1A8EE0 8027A600 A6020038 */  sh        $v0, 0x38($s0)
/* 1A8EE4 8027A604 8E450000 */  lw        $a1, 0x0($s2)
/* 1A8EE8 8027A608 0C0B1EAF */  jal       evt_get_variable
/* 1A8EEC 8027A60C 0260202D */   daddu    $a0, $s3, $zero
/* 1A8EF0 8027A610 AE62007C */  sw        $v0, 0x7C($s3)
/* 1A8EF4 8027A614 C620002C */  lwc1      $f0, 0x2C($s1)
/* 1A8EF8 8027A618 C618000C */  lwc1      $f24, 0xC($s0)
/* 1A8EFC 8027A61C C61A0014 */  lwc1      $f26, 0x14($s0)
/* 1A8F00 8027A620 C6160010 */  lwc1      $f22, 0x10($s0)
/* 1A8F04 8027A624 E6000000 */  swc1      $f0, 0x0($s0)
/* 1A8F08 8027A628 46000706 */  mov.s     $f28, $f0
/* 1A8F0C 8027A62C 4406C000 */  mfc1      $a2, $f24
/* 1A8F10 8027A630 4407D000 */  mfc1      $a3, $f26
/* 1A8F14 8027A634 C6200030 */  lwc1      $f0, 0x30($s1)
/* 1A8F18 8027A638 4600E306 */  mov.s     $f12, $f28
/* 1A8F1C 8027A63C E6000004 */  swc1      $f0, 0x4($s0)
/* 1A8F20 8027A640 C6340034 */  lwc1      $f20, 0x34($s1)
/* 1A8F24 8027A644 46000786 */  mov.s     $f30, $f0
/* 1A8F28 8027A648 4600A386 */  mov.s     $f14, $f20
/* 1A8F2C 8027A64C 0C00A720 */  jal       atan2
/* 1A8F30 8027A650 E6140008 */   swc1     $f20, 0x8($s0)
/* 1A8F34 8027A654 4600E306 */  mov.s     $f12, $f28
/* 1A8F38 8027A658 4600A386 */  mov.s     $f14, $f20
/* 1A8F3C 8027A65C 4406C000 */  mfc1      $a2, $f24
/* 1A8F40 8027A660 4407D000 */  mfc1      $a3, $f26
/* 1A8F44 8027A664 461EB781 */  sub.s     $f30, $f22, $f30
/* 1A8F48 8027A668 0C00A7B5 */  jal       dist2D
/* 1A8F4C 8027A66C E6000030 */   swc1     $f0, 0x30($s0)
/* 1A8F50 8027A670 86020038 */  lh        $v0, 0x38($s0)
/* 1A8F54 8027A674 46000106 */  mov.s     $f4, $f0
/* 1A8F58 8027A678 14400012 */  bnez      $v0, .L8027A6C4
/* 1A8F5C 8027A67C E6040034 */   swc1     $f4, 0x34($s0)
/* 1A8F60 8027A680 C6000028 */  lwc1      $f0, 0x28($s0)
/* 1A8F64 8027A684 C6020028 */  lwc1      $f2, 0x28($s0)
/* 1A8F68 8027A688 46002003 */  div.s     $f0, $f4, $f0
/* 1A8F6C 8027A68C 4600028D */  trunc.w.s $f10, $f0
/* 1A8F70 8027A690 44035000 */  mfc1      $v1, $f10
/* 1A8F74 8027A694 00000000 */  nop
/* 1A8F78 8027A698 00031400 */  sll       $v0, $v1, 16
/* 1A8F7C 8027A69C 00021403 */  sra       $v0, $v0, 16
/* 1A8F80 8027A6A0 44820000 */  mtc1      $v0, $f0
/* 1A8F84 8027A6A4 00000000 */  nop
/* 1A8F88 8027A6A8 46800020 */  cvt.s.w   $f0, $f0
/* 1A8F8C 8027A6AC 46020002 */  mul.s     $f0, $f0, $f2
/* 1A8F90 8027A6B0 00000000 */  nop
/* 1A8F94 8027A6B4 46002086 */  mov.s     $f2, $f4
/* 1A8F98 8027A6B8 A6030038 */  sh        $v1, 0x38($s0)
/* 1A8F9C 8027A6BC 0809E9BE */  j         .L8027A6F8
/* 1A8FA0 8027A6C0 46001201 */   sub.s    $f8, $f2, $f0
.L8027A6C4:
/* 1A8FA4 8027A6C4 44821000 */  mtc1      $v0, $f2
/* 1A8FA8 8027A6C8 00000000 */  nop
/* 1A8FAC 8027A6CC 468010A0 */  cvt.s.w   $f2, $f2
/* 1A8FB0 8027A6D0 86020038 */  lh        $v0, 0x38($s0)
/* 1A8FB4 8027A6D4 46022083 */  div.s     $f2, $f4, $f2
/* 1A8FB8 8027A6D8 44820000 */  mtc1      $v0, $f0
/* 1A8FBC 8027A6DC 00000000 */  nop
/* 1A8FC0 8027A6E0 46800020 */  cvt.s.w   $f0, $f0
/* 1A8FC4 8027A6E4 46020002 */  mul.s     $f0, $f0, $f2
/* 1A8FC8 8027A6E8 00000000 */  nop
/* 1A8FCC 8027A6EC C6040034 */  lwc1      $f4, 0x34($s0)
/* 1A8FD0 8027A6F0 E6020028 */  swc1      $f2, 0x28($s0)
/* 1A8FD4 8027A6F4 46002201 */  sub.s     $f8, $f4, $f0
.L8027A6F8:
/* 1A8FD8 8027A6F8 86020038 */  lh        $v0, 0x38($s0)
/* 1A8FDC 8027A6FC C6020024 */  lwc1      $f2, 0x24($s0)
/* 1A8FE0 8027A700 44823000 */  mtc1      $v0, $f6
/* 1A8FE4 8027A704 00000000 */  nop
/* 1A8FE8 8027A708 468031A0 */  cvt.s.w   $f6, $f6
/* 1A8FEC 8027A70C 46061082 */  mul.s     $f2, $f2, $f6
/* 1A8FF0 8027A710 00000000 */  nop
/* 1A8FF4 8027A714 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 1A8FF8 8027A718 44810000 */  mtc1      $at, $f0
/* 1A8FFC 8027A71C 00000000 */  nop
/* 1A9000 8027A720 46001082 */  mul.s     $f2, $f2, $f0
/* 1A9004 8027A724 00000000 */  nop
/* 1A9008 8027A728 C6040028 */  lwc1      $f4, 0x28($s0)
/* 1A900C 8027A72C 46003006 */  mov.s     $f0, $f6
/* 1A9010 8027A730 46004003 */  div.s     $f0, $f8, $f0
/* 1A9014 8027A734 46002100 */  add.s     $f4, $f4, $f0
/* 1A9018 8027A738 4606F183 */  div.s     $f6, $f30, $f6
/* 1A901C 8027A73C 46061080 */  add.s     $f2, $f2, $f6
/* 1A9020 8027A740 E6040028 */  swc1      $f4, 0x28($s0)
/* 1A9024 8027A744 E602002C */  swc1      $f2, 0x2C($s0)
/* 1A9028 8027A748 8E2200B4 */  lw        $v0, 0xB4($s1)
/* 1A902C 8027A74C 10400009 */  beqz      $v0, .L8027A774
/* 1A9030 8027A750 24020001 */   addiu    $v0, $zero, 0x1
/* 1A9034 8027A754 C6200034 */  lwc1      $f0, 0x34($s1)
/* 1A9038 8027A758 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A903C 8027A75C 8E2400B4 */  lw        $a0, 0xB4($s1)
/* 1A9040 8027A760 8E26002C */  lw        $a2, 0x2C($s1)
/* 1A9044 8027A764 8E270030 */  lw        $a3, 0x30($s1)
/* 1A9048 8027A768 0C052757 */  jal       sfx_play_sound_at_position
/* 1A904C 8027A76C 0000282D */   daddu    $a1, $zero, $zero
/* 1A9050 8027A770 24020001 */  addiu     $v0, $zero, 0x1
.L8027A774:
/* 1A9054 8027A774 AE620070 */  sw        $v0, 0x70($s3)
.L8027A778:
/* 1A9058 8027A778 8E710078 */  lw        $s1, 0x78($s3)
/* 1A905C 8027A77C 8E300010 */  lw        $s0, 0x10($s1)
/* 1A9060 8027A780 C6040004 */  lwc1      $f4, 0x4($s0)
/* 1A9064 8027A784 C600002C */  lwc1      $f0, 0x2C($s0)
/* 1A9068 8027A788 8E050028 */  lw        $a1, 0x28($s0)
/* 1A906C 8027A78C 46002100 */  add.s     $f4, $f4, $f0
/* 1A9070 8027A790 C6020024 */  lwc1      $f2, 0x24($s0)
/* 1A9074 8027A794 8E060030 */  lw        $a2, 0x30($s0)
/* 1A9078 8027A798 46020001 */  sub.s     $f0, $f0, $f2
/* 1A907C 8027A79C 0200202D */  daddu     $a0, $s0, $zero
/* 1A9080 8027A7A0 E6040004 */  swc1      $f4, 0x4($s0)
/* 1A9084 8027A7A4 0C099070 */  jal       add_xz_vec3f_copy1
/* 1A9088 8027A7A8 E600002C */   swc1     $f0, 0x2C($s0)
/* 1A908C 8027A7AC C6000000 */  lwc1      $f0, 0x0($s0)
/* 1A9090 8027A7B0 E620002C */  swc1      $f0, 0x2C($s1)
/* 1A9094 8027A7B4 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1A9098 8027A7B8 E6200030 */  swc1      $f0, 0x30($s1)
/* 1A909C 8027A7BC C6000008 */  lwc1      $f0, 0x8($s0)
/* 1A90A0 8027A7C0 E6200034 */  swc1      $f0, 0x34($s1)
/* 1A90A4 8027A7C4 96020038 */  lhu       $v0, 0x38($s0)
/* 1A90A8 8027A7C8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1A90AC 8027A7CC A6020038 */  sh        $v0, 0x38($s0)
/* 1A90B0 8027A7D0 00021400 */  sll       $v0, $v0, 16
/* 1A90B4 8027A7D4 1C400012 */  bgtz      $v0, .L8027A820
/* 1A90B8 8027A7D8 0000102D */   daddu    $v0, $zero, $zero
/* 1A90BC 8027A7DC 8E62007C */  lw        $v0, 0x7C($s3)
/* 1A90C0 8027A7E0 10400008 */  beqz      $v0, .L8027A804
/* 1A90C4 8027A7E4 00000000 */   nop
/* 1A90C8 8027A7E8 C6000030 */  lwc1      $f0, 0x30($s0)
/* 1A90CC 8027A7EC E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A90D0 8027A7F0 8E05000C */  lw        $a1, 0xC($s0)
/* 1A90D4 8027A7F4 8E060010 */  lw        $a2, 0x10($s0)
/* 1A90D8 8027A7F8 8E070014 */  lw        $a3, 0x14($s0)
/* 1A90DC 8027A7FC 0C0990BC */  jal       play_movement_dust_effects
/* 1A90E0 8027A800 24040002 */   addiu    $a0, $zero, 0x2
.L8027A804:
/* 1A90E4 8027A804 C600000C */  lwc1      $f0, 0xC($s0)
/* 1A90E8 8027A808 E620002C */  swc1      $f0, 0x2C($s1)
/* 1A90EC 8027A80C C6000010 */  lwc1      $f0, 0x10($s0)
/* 1A90F0 8027A810 E6200030 */  swc1      $f0, 0x30($s1)
/* 1A90F4 8027A814 C6000014 */  lwc1      $f0, 0x14($s0)
/* 1A90F8 8027A818 24020001 */  addiu     $v0, $zero, 0x1
/* 1A90FC 8027A81C E6200034 */  swc1      $f0, 0x34($s1)
.L8027A820:
/* 1A9100 8027A820 8FBF0028 */  lw        $ra, 0x28($sp)
/* 1A9104 8027A824 8FB30024 */  lw        $s3, 0x24($sp)
/* 1A9108 8027A828 8FB20020 */  lw        $s2, 0x20($sp)
/* 1A910C 8027A82C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1A9110 8027A830 8FB00018 */  lw        $s0, 0x18($sp)
/* 1A9114 8027A834 D7BE0058 */  ldc1      $f30, 0x58($sp)
/* 1A9118 8027A838 D7BC0050 */  ldc1      $f28, 0x50($sp)
/* 1A911C 8027A83C D7BA0048 */  ldc1      $f26, 0x48($sp)
/* 1A9120 8027A840 D7B80040 */  ldc1      $f24, 0x40($sp)
/* 1A9124 8027A844 D7B60038 */  ldc1      $f22, 0x38($sp)
/* 1A9128 8027A848 D7B40030 */  ldc1      $f20, 0x30($sp)
/* 1A912C 8027A84C 03E00008 */  jr        $ra
/* 1A9130 8027A850 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

ApiStatus JumpPartTo(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    Actor* actor;
    ActorPart* part;
    ActorPartMovement* movement;
    s32 actorID, partID;
    f32 posX, posY, posZ;
    f32 goalX, goalY, goalZ;
    f32 deltaDist;

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

    if (script->functionTemp[0] == 0) {
        actorID = evt_get_variable(script, *args++);
        if (actorID == ACTOR_SELF) {
            actorID = script->owner1.actorID;
        }
        partID = evt_get_variable(script, *args++);

        actor = get_actor(actorID);
        part = get_actor_part(actor, partID);
        script->functionTempPtr[1] = actor;
        script->functionTempPtr[2] = part;
        movement = part->movement;

        posX = evt_get_variable(script, *args++);
        posY = evt_get_variable(script, *args++);
        posZ = evt_get_variable(script, *args++);
        movement->goalPos.x = posX;
        movement->goalPos.y = posY;
        movement->goalPos.z = posZ;
        movement->moveTime = evt_get_variable(script, *args++);
        script->functionTemp[3] = evt_get_variable(script, *args++);

        goalX = movement->goalPos.x;
        goalY = movement->goalPos.y;
        goalZ = movement->goalPos.z;

        movement->absolutePosition.x = part->absolutePosition.x;
        movement->absolutePosition.y = part->absolutePosition.y;
        movement->absolutePosition.z = part->absolutePosition.z;

        posX = movement->absolutePosition.x;
        posY = movement->absolutePosition.y;
        posZ = movement->absolutePosition.z;

        movement->angle = atan2(posX, posZ, goalX, goalZ);
        movement->distance = dist2D(posX, posZ, goalX, goalZ);

        // make relative
        posX = (goalX - posX);
        posY = (goalY - posY);
        posZ = (goalZ - posZ);

        if (movement->moveTime == 0) {
            movement->moveTime = movement->distance / movement->moveSpeed;
            deltaDist = movement->distance - movement->moveTime * movement->moveSpeed;
        } else {
            movement->moveSpeed = movement->distance / movement->moveTime;
            deltaDist = movement->distance - movement->moveTime * movement->moveSpeed;
        }
        movement->moveSpeed += deltaDist / movement->moveTime;
        movement->unk_2C = movement->jumpScale * movement->moveTime * 0.5f + posY / movement->moveTime;
        if (part->partTypeData[4] != 0) {
            sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
        }
        script->functionTemp[0] = 1;
    }

    part = script->functionTempPtr[2];
    movement = part->movement;
    movement->absolutePosition.y += movement->unk_2C;
    movement->unk_2C -= movement->jumpScale;
    add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle);
    part->absolutePosition.x = movement->absolutePosition.x;
    part->absolutePosition.y = movement->absolutePosition.y;
    part->absolutePosition.z = movement->absolutePosition.z;
    movement->moveTime--;

    if (movement->moveTime <= 0) {
        if (script->functionTemp[3] != 0) {
            play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle);
        }
        part->absolutePosition.x = movement->goalPos.x;
        part->absolutePosition.y = movement->goalPos.y;
        part->absolutePosition.z = movement->goalPos.z;
        return ApiStatus_DONE1;
    } else {
        return ApiStatus_BLOCK;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel IdleFlyToGoal
/* 1AA498 8027BBB8 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* 1AA49C 8027BBBC AFB20020 */  sw        $s2, 0x20($sp)
/* 1AA4A0 8027BBC0 0080902D */  daddu     $s2, $a0, $zero
/* 1AA4A4 8027BBC4 AFBF0024 */  sw        $ra, 0x24($sp)
/* 1AA4A8 8027BBC8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1AA4AC 8027BBCC AFB00018 */  sw        $s0, 0x18($sp)
/* 1AA4B0 8027BBD0 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 1AA4B4 8027BBD4 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 1AA4B8 8027BBD8 10A0004F */  beqz      $a1, .L8027BD18
/* 1AA4BC 8027BBDC 8E51000C */   lw       $s1, 0xC($s2)
/* 1AA4C0 8027BBE0 8E250000 */  lw        $a1, 0x0($s1)
/* 1AA4C4 8027BBE4 0C0B1EAF */  jal       evt_get_variable
/* 1AA4C8 8027BBE8 26310004 */   addiu    $s1, $s1, 0x4
/* 1AA4CC 8027BBEC 0040202D */  daddu     $a0, $v0, $zero
/* 1AA4D0 8027BBF0 2402FF81 */  addiu     $v0, $zero, -0x7F
/* 1AA4D4 8027BBF4 14820002 */  bne       $a0, $v0, .L8027BC00
/* 1AA4D8 8027BBF8 00000000 */   nop
/* 1AA4DC 8027BBFC 8E440148 */  lw        $a0, 0x148($s2)
.L8027BC00:
/* 1AA4E0 8027BC00 0C09A75B */  jal       get_actor
/* 1AA4E4 8027BC04 00000000 */   nop
/* 1AA4E8 8027BC08 0040802D */  daddu     $s0, $v0, $zero
/* 1AA4EC 8027BC0C AE500074 */  sw        $s0, 0x74($s2)
/* 1AA4F0 8027BC10 8E250000 */  lw        $a1, 0x0($s1)
/* 1AA4F4 8027BC14 26310004 */  addiu     $s1, $s1, 0x4
/* 1AA4F8 8027BC18 0C0B1EAF */  jal       evt_get_variable
/* 1AA4FC 8027BC1C 0240202D */   daddu    $a0, $s2, $zero
/* 1AA500 8027BC20 A6020120 */  sh        $v0, 0x120($s0)
/* 1AA504 8027BC24 8E250000 */  lw        $a1, 0x0($s1)
/* 1AA508 8027BC28 26310004 */  addiu     $s1, $s1, 0x4
/* 1AA50C 8027BC2C 0C0B1EAF */  jal       evt_get_variable
/* 1AA510 8027BC30 0240202D */   daddu    $a0, $s2, $zero
/* 1AA514 8027BC34 A6020122 */  sh        $v0, 0x122($s0)
/* 1AA518 8027BC38 8E250000 */  lw        $a1, 0x0($s1)
/* 1AA51C 8027BC3C 0C0B1EAF */  jal       evt_get_variable
/* 1AA520 8027BC40 0240202D */   daddu    $a0, $s2, $zero
/* 1AA524 8027BC44 AE42007C */  sw        $v0, 0x7C($s2)
/* 1AA528 8027BC48 C60000D4 */  lwc1      $f0, 0xD4($s0)
/* 1AA52C 8027BC4C C6060144 */  lwc1      $f6, 0x144($s0)
/* 1AA530 8027BC50 46003081 */  sub.s     $f2, $f6, $f0
/* 1AA534 8027BC54 46021202 */  mul.s     $f8, $f2, $f2
/* 1AA538 8027BC58 00000000 */  nop
/* 1AA53C 8027BC5C C6040148 */  lwc1      $f4, 0x148($s0)
/* 1AA540 8027BC60 C60000D8 */  lwc1      $f0, 0xD8($s0)
/* 1AA544 8027BC64 46002081 */  sub.s     $f2, $f4, $f0
/* 1AA548 8027BC68 46021282 */  mul.s     $f10, $f2, $f2
/* 1AA54C 8027BC6C 00000000 */  nop
/* 1AA550 8027BC70 C60000DC */  lwc1      $f0, 0xDC($s0)
/* 1AA554 8027BC74 C602014C */  lwc1      $f2, 0x14C($s0)
/* 1AA558 8027BC78 46001001 */  sub.s     $f0, $f2, $f0
/* 1AA55C 8027BC7C 46000002 */  mul.s     $f0, $f0, $f0
/* 1AA560 8027BC80 00000000 */  nop
/* 1AA564 8027BC84 E60600C8 */  swc1      $f6, 0xC8($s0)
/* 1AA568 8027BC88 E60600E0 */  swc1      $f6, 0xE0($s0)
/* 1AA56C 8027BC8C 460A4200 */  add.s     $f8, $f8, $f10
/* 1AA570 8027BC90 E60400CC */  swc1      $f4, 0xCC($s0)
/* 1AA574 8027BC94 E60400E4 */  swc1      $f4, 0xE4($s0)
/* 1AA578 8027BC98 46004300 */  add.s     $f12, $f8, $f0
/* 1AA57C 8027BC9C E60200D0 */  swc1      $f2, 0xD0($s0)
/* 1AA580 8027BCA0 E60200E8 */  swc1      $f2, 0xE8($s0)
/* 1AA584 8027BCA4 46006084 */  sqrt.s    $f2, $f12
/* 1AA588 8027BCA8 46021032 */  c.eq.s    $f2, $f2
/* 1AA58C 8027BCAC 00000000 */  nop
/* 1AA590 8027BCB0 45010004 */  bc1t      .L8027BCC4
/* 1AA594 8027BCB4 261100C8 */   addiu    $s1, $s0, 0xC8
/* 1AA598 8027BCB8 0C0187BC */  jal       sqrtf
/* 1AA59C 8027BCBC 00000000 */   nop
/* 1AA5A0 8027BCC0 46000086 */  mov.s     $f2, $f0
.L8027BCC4:
/* 1AA5A4 8027BCC4 86020120 */  lh        $v0, 0x120($s0)
/* 1AA5A8 8027BCC8 14400007 */  bnez      $v0, .L8027BCE8
/* 1AA5AC 8027BCCC E6020114 */   swc1     $f2, 0x114($s0)
/* 1AA5B0 8027BCD0 C6000108 */  lwc1      $f0, 0x108($s0)
/* 1AA5B4 8027BCD4 46001003 */  div.s     $f0, $f2, $f0
/* 1AA5B8 8027BCD8 4600038D */  trunc.w.s $f14, $f0
/* 1AA5BC 8027BCDC 44027000 */  mfc1      $v0, $f14
/* 1AA5C0 8027BCE0 0809EF3F */  j         .L8027BCFC
/* 1AA5C4 8027BCE4 A6020120 */   sh       $v0, 0x120($s0)
.L8027BCE8:
/* 1AA5C8 8027BCE8 44820000 */  mtc1      $v0, $f0
/* 1AA5CC 8027BCEC 00000000 */  nop
/* 1AA5D0 8027BCF0 46800020 */  cvt.s.w   $f0, $f0
/* 1AA5D4 8027BCF4 46001003 */  div.s     $f0, $f2, $f0
/* 1AA5D8 8027BCF8 E6000108 */  swc1      $f0, 0x108($s0)
.L8027BCFC:
/* 1AA5DC 8027BCFC 86220058 */  lh        $v0, 0x58($s1)
/* 1AA5E0 8027BD00 54400003 */  bnel      $v0, $zero, .L8027BD10
/* 1AA5E4 8027BD04 AE200050 */   sw       $zero, 0x50($s1)
/* 1AA5E8 8027BD08 0809EFC6 */  j         .L8027BF18
/* 1AA5EC 8027BD0C 24020002 */   addiu    $v0, $zero, 0x2
.L8027BD10:
/* 1AA5F0 8027BD10 AE200048 */  sw        $zero, 0x48($s1)
/* 1AA5F4 8027BD14 AE200044 */  sw        $zero, 0x44($s1)
.L8027BD18:
/* 1AA5F8 8027BD18 8E500074 */  lw        $s0, 0x74($s2)
/* 1AA5FC 8027BD1C 86020120 */  lh        $v0, 0x120($s0)
/* 1AA600 8027BD20 C6000118 */  lwc1      $f0, 0x118($s0)
/* 1AA604 8027BD24 AFA20010 */  sw        $v0, 0x10($sp)
/* 1AA608 8027BD28 8E44007C */  lw        $a0, 0x7C($s2)
/* 1AA60C 8027BD2C 8E0500E0 */  lw        $a1, 0xE0($s0)
/* 1AA610 8027BD30 8E0600D4 */  lw        $a2, 0xD4($s0)
/* 1AA614 8027BD34 4600038D */  trunc.w.s $f14, $f0
/* 1AA618 8027BD38 44077000 */  mfc1      $a3, $f14
/* 1AA61C 8027BD3C 0C09EC37 */  jal       update_lerp_battle
/* 1AA620 8027BD40 00000000 */   nop
/* 1AA624 8027BD44 C6020118 */  lwc1      $f2, 0x118($s0)
/* 1AA628 8027BD48 86020120 */  lh        $v0, 0x120($s0)
/* 1AA62C 8027BD4C E60000C8 */  swc1      $f0, 0xC8($s0)
/* 1AA630 8027BD50 AFA20010 */  sw        $v0, 0x10($sp)
/* 1AA634 8027BD54 8E44007C */  lw        $a0, 0x7C($s2)
/* 1AA638 8027BD58 8E0500E4 */  lw        $a1, 0xE4($s0)
/* 1AA63C 8027BD5C 8E0600D8 */  lw        $a2, 0xD8($s0)
/* 1AA640 8027BD60 4600138D */  trunc.w.s $f14, $f2
/* 1AA644 8027BD64 44077000 */  mfc1      $a3, $f14
/* 1AA648 8027BD68 0C09EC37 */  jal       update_lerp_battle
/* 1AA64C 8027BD6C 00000000 */   nop
/* 1AA650 8027BD70 C6020118 */  lwc1      $f2, 0x118($s0)
/* 1AA654 8027BD74 86020120 */  lh        $v0, 0x120($s0)
/* 1AA658 8027BD78 E60000CC */  swc1      $f0, 0xCC($s0)
/* 1AA65C 8027BD7C AFA20010 */  sw        $v0, 0x10($sp)
/* 1AA660 8027BD80 8E44007C */  lw        $a0, 0x7C($s2)
/* 1AA664 8027BD84 8E0500E8 */  lw        $a1, 0xE8($s0)
/* 1AA668 8027BD88 8E0600DC */  lw        $a2, 0xDC($s0)
/* 1AA66C 8027BD8C 4600138D */  trunc.w.s $f14, $f2
/* 1AA670 8027BD90 44077000 */  mfc1      $a3, $f14
/* 1AA674 8027BD94 0C09EC37 */  jal       update_lerp_battle
/* 1AA678 8027BD98 00000000 */   nop
/* 1AA67C 8027BD9C C6020118 */  lwc1      $f2, 0x118($s0)
/* 1AA680 8027BDA0 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 1AA684 8027BDA4 4481B000 */  mtc1      $at, $f22
/* 1AA688 8027BDA8 86020120 */  lh        $v0, 0x120($s0)
/* 1AA68C 8027BDAC 46161080 */  add.s     $f2, $f2, $f22
/* 1AA690 8027BDB0 E60000D0 */  swc1      $f0, 0xD0($s0)
/* 1AA694 8027BDB4 44820000 */  mtc1      $v0, $f0
/* 1AA698 8027BDB8 00000000 */  nop
/* 1AA69C 8027BDBC 46800020 */  cvt.s.w   $f0, $f0
/* 1AA6A0 8027BDC0 4602003C */  c.lt.s    $f0, $f2
/* 1AA6A4 8027BDC4 00000000 */  nop
/* 1AA6A8 8027BDC8 45000009 */  bc1f      .L8027BDF0
/* 1AA6AC 8027BDCC E6020118 */   swc1     $f2, 0x118($s0)
/* 1AA6B0 8027BDD0 C60000D4 */  lwc1      $f0, 0xD4($s0)
/* 1AA6B4 8027BDD4 C60200D8 */  lwc1      $f2, 0xD8($s0)
/* 1AA6B8 8027BDD8 C60400DC */  lwc1      $f4, 0xDC($s0)
/* 1AA6BC 8027BDDC 24020002 */  addiu     $v0, $zero, 0x2
/* 1AA6C0 8027BDE0 E6000144 */  swc1      $f0, 0x144($s0)
/* 1AA6C4 8027BDE4 E6020148 */  swc1      $f2, 0x148($s0)
/* 1AA6C8 8027BDE8 0809EFC6 */  j         .L8027BF18
/* 1AA6CC 8027BDEC E604014C */   swc1     $f4, 0x14C($s0)
.L8027BDF0:
/* 1AA6D0 8027BDF0 C60200D4 */  lwc1      $f2, 0xD4($s0)
/* 1AA6D4 8027BDF4 C60000C8 */  lwc1      $f0, 0xC8($s0)
/* 1AA6D8 8027BDF8 46001081 */  sub.s     $f2, $f2, $f0
/* 1AA6DC 8027BDFC 46021102 */  mul.s     $f4, $f2, $f2
/* 1AA6E0 8027BE00 00000000 */  nop
/* 1AA6E4 8027BE04 C60000CC */  lwc1      $f0, 0xCC($s0)
/* 1AA6E8 8027BE08 C60200D8 */  lwc1      $f2, 0xD8($s0)
/* 1AA6EC 8027BE0C 46001081 */  sub.s     $f2, $f2, $f0
/* 1AA6F0 8027BE10 46021182 */  mul.s     $f6, $f2, $f2
/* 1AA6F4 8027BE14 00000000 */  nop
/* 1AA6F8 8027BE18 C60000D0 */  lwc1      $f0, 0xD0($s0)
/* 1AA6FC 8027BE1C C60200DC */  lwc1      $f2, 0xDC($s0)
/* 1AA700 8027BE20 46001001 */  sub.s     $f0, $f2, $f0
/* 1AA704 8027BE24 46000002 */  mul.s     $f0, $f0, $f0
/* 1AA708 8027BE28 00000000 */  nop
/* 1AA70C 8027BE2C 46062100 */  add.s     $f4, $f4, $f6
/* 1AA710 8027BE30 46002300 */  add.s     $f12, $f4, $f0
/* 1AA714 8027BE34 46006004 */  sqrt.s    $f0, $f12
/* 1AA718 8027BE38 46000032 */  c.eq.s    $f0, $f0
/* 1AA71C 8027BE3C 00000000 */  nop
/* 1AA720 8027BE40 45010003 */  bc1t      .L8027BE50
/* 1AA724 8027BE44 00000000 */   nop
/* 1AA728 8027BE48 0C0187BC */  jal       sqrtf
/* 1AA72C 8027BE4C 00000000 */   nop
.L8027BE50:
/* 1AA730 8027BE50 4480A000 */  mtc1      $zero, $f20
/* 1AA734 8027BE54 46000086 */  mov.s     $f2, $f0
/* 1AA738 8027BE58 46141032 */  c.eq.s    $f2, $f20
/* 1AA73C 8027BE5C 00000000 */  nop
/* 1AA740 8027BE60 45030001 */  bc1tl     .L8027BE68
/* 1AA744 8027BE64 4600B086 */   mov.s    $f2, $f22
.L8027BE68:
/* 1AA748 8027BE68 C6000114 */  lwc1      $f0, 0x114($s0)
/* 1AA74C 8027BE6C 46140032 */  c.eq.s    $f0, $f20
/* 1AA750 8027BE70 00000000 */  nop
/* 1AA754 8027BE74 45030001 */  bc1tl     .L8027BE7C
/* 1AA758 8027BE78 E6160114 */   swc1     $f22, 0x114($s0)
.L8027BE7C:
/* 1AA75C 8027BE7C C6000114 */  lwc1      $f0, 0x114($s0)
/* 1AA760 8027BE80 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 1AA764 8027BE84 44816800 */  mtc1      $at, $f13
/* 1AA768 8027BE88 44806000 */  mtc1      $zero, $f12
/* 1AA76C 8027BE8C 46001003 */  div.s     $f0, $f2, $f0
/* 1AA770 8027BE90 46000021 */  cvt.d.s   $f0, $f0
/* 1AA774 8027BE94 46206301 */  sub.d     $f12, $f12, $f0
/* 1AA778 8027BE98 3C01802A */  lui       $at, %hi(D_8029DA18)
/* 1AA77C 8027BE9C D420DA18 */  ldc1      $f0, %lo(D_8029DA18)($at)
/* 1AA780 8027BEA0 46206302 */  mul.d     $f12, $f12, $f0
/* 1AA784 8027BEA4 00000000 */  nop
/* 1AA788 8027BEA8 0C00A8BB */  jal       sin_deg
/* 1AA78C 8027BEAC 46206320 */   cvt.s.d  $f12, $f12
/* 1AA790 8027BEB0 86030122 */  lh        $v1, 0x122($s0)
/* 1AA794 8027BEB4 14600002 */  bnez      $v1, .L8027BEC0
/* 1AA798 8027BEB8 46000186 */   mov.s    $f6, $f0
/* 1AA79C 8027BEBC 4600A186 */  mov.s     $f6, $f20
.L8027BEC0:
/* 1AA7A0 8027BEC0 04610007 */  bgez      $v1, .L8027BEE0
/* 1AA7A4 8027BEC4 00031023 */   negu     $v0, $v1
/* 1AA7A8 8027BEC8 44821000 */  mtc1      $v0, $f2
/* 1AA7AC 8027BECC 00000000 */  nop
/* 1AA7B0 8027BED0 468010A0 */  cvt.s.w   $f2, $f2
/* 1AA7B4 8027BED4 46003007 */  neg.s     $f0, $f6
/* 1AA7B8 8027BED8 46020182 */  mul.s     $f6, $f0, $f2
/* 1AA7BC 8027BEDC 00000000 */  nop
.L8027BEE0:
/* 1AA7C0 8027BEE0 18600006 */  blez      $v1, .L8027BEFC
/* 1AA7C4 8027BEE4 0000102D */   daddu    $v0, $zero, $zero
/* 1AA7C8 8027BEE8 44830000 */  mtc1      $v1, $f0
/* 1AA7CC 8027BEEC 00000000 */  nop
/* 1AA7D0 8027BEF0 46800020 */  cvt.s.w   $f0, $f0
/* 1AA7D4 8027BEF4 46003182 */  mul.s     $f6, $f6, $f0
/* 1AA7D8 8027BEF8 00000000 */  nop
.L8027BEFC:
/* 1AA7DC 8027BEFC C60000C8 */  lwc1      $f0, 0xC8($s0)
/* 1AA7E0 8027BF00 C60200CC */  lwc1      $f2, 0xCC($s0)
/* 1AA7E4 8027BF04 C60400D0 */  lwc1      $f4, 0xD0($s0)
/* 1AA7E8 8027BF08 46061080 */  add.s     $f2, $f2, $f6
/* 1AA7EC 8027BF0C E6000144 */  swc1      $f0, 0x144($s0)
/* 1AA7F0 8027BF10 E604014C */  swc1      $f4, 0x14C($s0)
/* 1AA7F4 8027BF14 E6020148 */  swc1      $f2, 0x148($s0)
.L8027BF18:
/* 1AA7F8 8027BF18 8FBF0024 */  lw        $ra, 0x24($sp)
/* 1AA7FC 8027BF1C 8FB20020 */  lw        $s2, 0x20($sp)
/* 1AA800 8027BF20 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1AA804 8027BF24 8FB00018 */  lw        $s0, 0x18($sp)
/* 1AA808 8027BF28 D7B60030 */  ldc1      $f22, 0x30($sp)
/* 1AA80C 8027BF2C D7B40028 */  ldc1      $f20, 0x28($sp)
/* 1AA810 8027BF30 03E00008 */  jr        $ra
/* 1AA814 8027BF34 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

ApiStatus IdleFlyToGoal(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    Actor* actor;
    ActorMovement* movement;
    s32 actorID;
    f32 posX, posY, posZ;
    f32 goalX, goalY, goalZ;
    f32 deltaX, deltaY, deltaZ;
    f32 dist3D;
    f32 offsetY;

    if (isInitialCall) {
        actorID = evt_get_variable(script, *args++);
        if (actorID == ACTOR_SELF) {
            actorID = script->owner1.enemyID;
        }
        script->functionTempPtr[1] = actor = get_actor(actorID);
        movement = &actor->fly;

        movement->flyTime = evt_get_variable(script, *args++);
        movement->flyArcAmplitude = evt_get_variable(script, *args++);
        script->functionTemp[3] = evt_get_variable(script, *args++);

        goalX = movement->goalPos.x;
        goalY = movement->goalPos.y;
        goalZ = movement->goalPos.z;

        posX = actor->currentPos.x;
        posY = actor->currentPos.y;
        posZ = actor->currentPos.z;

        deltaX = posX - goalX;
        deltaY = posY - goalY;
        deltaZ = posZ - goalZ;

        movement->currentPos.x = posX;
        movement->unk_18.x = posX;
        movement->currentPos.y = posY;
        movement->unk_18.y = posY;
        movement->currentPos.z = posZ;
        movement->unk_18.z = posZ;

        movement->distance = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ));

        if (movement->flyTime == 0) {
            movement->flyTime = movement->distance / movement->speed;
        } else {
            movement->speed = movement->distance / movement->flyTime;
        }
        if (movement->flyTime == 0) {
            return ApiStatus_DONE2;
        }

        movement->flyElapsed = 0.0f;
        movement->angle = 0.0f;
        movement->velocity = 0.0f;
    }

    actor = script->functionTempPtr[1];
    movement = &actor->fly;

    movement->currentPos.x = update_lerp_battle(script->functionTemp[3], movement->unk_18.x, movement->goalPos.x, movement->flyElapsed, movement->flyTime);
    movement->currentPos.y = update_lerp_battle(script->functionTemp[3], movement->unk_18.y, movement->goalPos.y, movement->flyElapsed, movement->flyTime);
    movement->currentPos.z = update_lerp_battle(script->functionTemp[3], movement->unk_18.z, movement->goalPos.z, movement->flyElapsed, movement->flyTime);

    movement->flyElapsed += 1.0f;
    if (movement->flyTime < movement->flyElapsed) {
        actor->currentPos.x = movement->goalPos.x;
        actor->currentPos.y = movement->goalPos.y;
        actor->currentPos.z = movement->goalPos.z;
        return ApiStatus_DONE2;
    }

    deltaX = movement->goalPos.x - movement->currentPos.x;
    deltaY = movement->goalPos.y - movement->currentPos.y;
    deltaZ = movement->goalPos.z - movement->currentPos.z;
    dist3D = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ));
    if (dist3D == 0.0f) {
        dist3D = 1.0f;
    }
    if (movement->distance == 0.0f) {
        movement->distance = 1.0f;
    }

    offsetY = sin_deg((1.0 - (dist3D / movement->distance)) * 180.0);
    if (movement->flyArcAmplitude == 0) {
        offsetY = 0.0f;
    }
    if (movement->flyArcAmplitude < 0) {
        offsetY = -offsetY * -movement->flyArcAmplitude;
    }
    if (movement->flyArcAmplitude > 0) {
        offsetY = offsetY * movement->flyArcAmplitude;
    }

    actor->currentPos.x = movement->currentPos.x;
    actor->currentPos.y = movement->currentPos.y + offsetY;
    actor->currentPos.z = movement->currentPos.z;
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_driver_init
/* 31650 80056250 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 31654 80056254 AFB50024 */  sw        $s5, 0x24($sp)
/* 31658 80056258 00A0A82D */  daddu     $s5, $a1, $zero
/* 3165C 8005625C 3C038008 */  lui       $v1, %hi(gActiveSynDriverPtr)
/* 31660 80056260 24638E50 */  addiu     $v1, $v1, %lo(gActiveSynDriverPtr)
/* 31664 80056264 AFBF002C */  sw        $ra, 0x2C($sp)
/* 31668 80056268 AFB60028 */  sw        $s6, 0x28($sp)
/* 3166C 8005626C AFB40020 */  sw        $s4, 0x20($sp)
/* 31670 80056270 AFB3001C */  sw        $s3, 0x1C($sp)
/* 31674 80056274 AFB20018 */  sw        $s2, 0x18($sp)
/* 31678 80056278 AFB10014 */  sw        $s1, 0x14($sp)
/* 3167C 8005627C AFB00010 */  sw        $s0, 0x10($sp)
/* 31680 80056280 8C620000 */  lw        $v0, 0x0($v1)
/* 31684 80056284 8EB30014 */  lw        $s3, 0x14($s5)
/* 31688 80056288 144000BC */  bnez      $v0, .L8005657C
/* 3168C 8005628C 0080382D */   daddu    $a3, $a0, $zero
/* 31690 80056290 8EA20000 */  lw        $v0, 0x0($s5)
/* 31694 80056294 0260202D */  daddu     $a0, $s3, $zero
/* 31698 80056298 ACE2000C */  sw        $v0, 0xC($a3)
/* 3169C 8005629C 8EA20004 */  lw        $v0, 0x4($s5)
/* 316A0 800562A0 AC670000 */  sw        $a3, 0x0($v1)
/* 316A4 800562A4 ACE00000 */  sw        $zero, 0x0($a3)
/* 316A8 800562A8 ACE00004 */  sw        $zero, 0x4($a3)
/* 316AC 800562AC ACE20010 */  sw        $v0, 0x10($a3)
/* 316B0 800562B0 8EA20008 */  lw        $v0, 0x8($s5)
/* 316B4 800562B4 3C108008 */  lui       $s0, %hi(gSynDriverPtr)
/* 316B8 800562B8 26108E54 */  addiu     $s0, $s0, %lo(gSynDriverPtr)
/* 316BC 800562BC AE070000 */  sw        $a3, 0x0($s0)
/* 316C0 800562C0 3C018008 */  lui       $at, %hi(AuUseGlobalVolume)
/* 316C4 800562C4 A0208E58 */  sb        $zero, %lo(AuUseGlobalVolume)($at)
/* 316C8 800562C8 ACE20008 */  sw        $v0, 0x8($a3)
/* 316CC 800562CC 8EA30010 */  lw        $v1, 0x10($s5)
/* 316D0 800562D0 24027FFF */  addiu     $v0, $zero, 0x7FFF
/* 316D4 800562D4 3C018008 */  lui       $at, %hi(AuGlobalVolume)
/* 316D8 800562D8 A4228E5A */  sh        $v0, %lo(AuGlobalVolume)($at)
/* 316DC 800562DC ACE30014 */  sw        $v1, 0x14($a3)
/* 316E0 800562E0 8EA50000 */  lw        $a1, 0x0($s5)
/* 316E4 800562E4 24020001 */  addiu     $v0, $zero, 0x1
/* 316E8 800562E8 3C018008 */  lui       $at, %hi(AuSynStereoDirty)
/* 316EC 800562EC A0228E5C */  sb        $v0, %lo(AuSynStereoDirty)($at)
/* 316F0 800562F0 0C015FE4 */  jal       alHeapAlloc
/* 316F4 800562F4 2406007C */   addiu    $a2, $zero, 0x7C
/* 316F8 800562F8 8E030000 */  lw        $v1, 0x0($s0)
/* 316FC 800562FC AC62001C */  sw        $v0, 0x1C($v1)
/* 31700 80056300 8EA20000 */  lw        $v0, 0x0($s5)
/* 31704 80056304 18400043 */  blez      $v0, .L80056414
/* 31708 80056308 0000882D */   daddu    $s1, $zero, $zero
/* 3170C 8005630C 0200B02D */  daddu     $s6, $s0, $zero
/* 31710 80056310 24120001 */  addiu     $s2, $zero, 0x1
/* 31714 80056314 0220A02D */  daddu     $s4, $s1, $zero
/* 31718 80056318 0260202D */  daddu     $a0, $s3, $zero
.L8005631C:
/* 3171C 8005631C 8EC20000 */  lw        $v0, 0x0($s6)
/* 31720 80056320 24050001 */  addiu     $a1, $zero, 0x1
/* 31724 80056324 8C50001C */  lw        $s0, 0x1C($v0)
/* 31728 80056328 24060020 */  addiu     $a2, $zero, 0x20
/* 3172C 8005632C 0C015FE4 */  jal       alHeapAlloc
/* 31730 80056330 02148021 */   addu     $s0, $s0, $s4
/* 31734 80056334 0260202D */  daddu     $a0, $s3, $zero
/* 31738 80056338 24050001 */  addiu     $a1, $zero, 0x1
/* 3173C 8005633C 24060020 */  addiu     $a2, $zero, 0x20
/* 31740 80056340 0C015FE4 */  jal       alHeapAlloc
/* 31744 80056344 AE020004 */   sw       $v0, 0x4($s0)
/* 31748 80056348 8EC30000 */  lw        $v1, 0x0($s6)
/* 3174C 8005634C 26040024 */  addiu     $a0, $s0, 0x24
/* 31750 80056350 AE020008 */  sw        $v0, 0x8($s0)
/* 31754 80056354 8C620014 */  lw        $v0, 0x14($v1)
/* 31758 80056358 0040F809 */  jalr      $v0
/* 3175C 8005635C 2694007C */   addiu    $s4, $s4, 0x7C
/* 31760 80056360 0260202D */  daddu     $a0, $s3, $zero
/* 31764 80056364 24050001 */  addiu     $a1, $zero, 0x1
/* 31768 80056368 24060020 */  addiu     $a2, $zero, 0x20
/* 3176C 8005636C AE020020 */  sw        $v0, 0x20($s0)
/* 31770 80056370 AE00002C */  sw        $zero, 0x2C($s0)
/* 31774 80056374 AE120030 */  sw        $s2, 0x30($s0)
/* 31778 80056378 0C015FE4 */  jal       alHeapAlloc
/* 3177C 8005637C AE000034 */   sw       $zero, 0x34($s0)
/* 31780 80056380 0260202D */  daddu     $a0, $s3, $zero
/* 31784 80056384 24050001 */  addiu     $a1, $zero, 0x1
/* 31788 80056388 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3178C 8005638C 44810000 */  mtc1      $at, $f0
/* 31790 80056390 24060050 */  addiu     $a2, $zero, 0x50
/* 31794 80056394 AE020038 */  sw        $v0, 0x38($s0)
/* 31798 80056398 AE000040 */  sw        $zero, 0x40($s0)
/* 3179C 8005639C AE120044 */  sw        $s2, 0x44($s0)
/* 317A0 800563A0 0C015FE4 */  jal       alHeapAlloc
/* 317A4 800563A4 E600003C */   swc1     $f0, 0x3C($s0)
/* 317A8 800563A8 AE020048 */  sw        $v0, 0x48($s0)
/* 317AC 800563AC 24020040 */  addiu     $v0, $zero, 0x40
/* 317B0 800563B0 AE12006C */  sw        $s2, 0x6C($s0)
/* 317B4 800563B4 AE000070 */  sw        $zero, 0x70($s0)
/* 317B8 800563B8 A612004E */  sh        $s2, 0x4E($s0)
/* 317BC 800563BC A612005C */  sh        $s2, 0x5C($s0)
/* 317C0 800563C0 A6120062 */  sh        $s2, 0x62($s0)
/* 317C4 800563C4 A6120050 */  sh        $s2, 0x50($s0)
/* 317C8 800563C8 A6120052 */  sh        $s2, 0x52($s0)
/* 317CC 800563CC A6000054 */  sh        $zero, 0x54($s0)
/* 317D0 800563D0 A6000056 */  sh        $zero, 0x56($s0)
/* 317D4 800563D4 A612005A */  sh        $s2, 0x5A($s0)
/* 317D8 800563D8 A6000058 */  sh        $zero, 0x58($s0)
/* 317DC 800563DC A6120060 */  sh        $s2, 0x60($s0)
/* 317E0 800563E0 A600005E */  sh        $zero, 0x5E($s0)
/* 317E4 800563E4 AE000064 */  sw        $zero, 0x64($s0)
/* 317E8 800563E8 AE000068 */  sw        $zero, 0x68($s0)
/* 317EC 800563EC A602004C */  sh        $v0, 0x4C($s0)
/* 317F0 800563F0 A6000074 */  sh        $zero, 0x74($s0)
/* 317F4 800563F4 AE000000 */  sw        $zero, 0x0($s0)
/* 317F8 800563F8 A2000078 */  sb        $zero, 0x78($s0)
/* 317FC 800563FC A2110079 */  sb        $s1, 0x79($s0)
/* 31800 80056400 8EA20000 */  lw        $v0, 0x0($s5)
/* 31804 80056404 26310001 */  addiu     $s1, $s1, 0x1
/* 31808 80056408 0222102A */  slt       $v0, $s1, $v0
/* 3180C 8005640C 1440FFC3 */  bnez      $v0, .L8005631C
/* 31810 80056410 0260202D */   daddu    $a0, $s3, $zero
.L80056414:
/* 31814 80056414 0260202D */  daddu     $a0, $s3, $zero
/* 31818 80056418 8EA50004 */  lw        $a1, 0x4($s5)
/* 3181C 8005641C 0C015FE4 */  jal       alHeapAlloc
/* 31820 80056420 24060018 */   addiu    $a2, $zero, 0x18
/* 31824 80056424 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31828 80056428 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 3182C 8005642C AC620020 */  sw        $v0, 0x20($v1)
/* 31830 80056430 8EA20004 */  lw        $v0, 0x4($s5)
/* 31834 80056434 18400022 */  blez      $v0, .L800564C0
/* 31838 80056438 0000882D */   daddu    $s1, $zero, $zero
/* 3183C 8005643C 24147FFF */  addiu     $s4, $zero, 0x7FFF
/* 31840 80056440 0220902D */  daddu     $s2, $s1, $zero
.L80056444:
/* 31844 80056444 0260202D */  daddu     $a0, $s3, $zero
/* 31848 80056448 24050001 */  addiu     $a1, $zero, 0x1
/* 3184C 8005644C 3C028008 */  lui       $v0, %hi(gSynDriverPtr)
/* 31850 80056450 8C428E54 */  lw        $v0, %lo(gSynDriverPtr)($v0)
/* 31854 80056454 24060014 */  addiu     $a2, $zero, 0x14
/* 31858 80056458 8C500020 */  lw        $s0, 0x20($v0)
/* 3185C 8005645C 02258821 */  addu      $s1, $s1, $a1
/* 31860 80056460 02128021 */  addu      $s0, $s0, $s2
/* 31864 80056464 AE000010 */  sw        $zero, 0x10($s0)
/* 31868 80056468 AE000014 */  sw        $zero, 0x14($s0)
/* 3186C 8005646C A6140000 */  sh        $s4, 0x0($s0)
/* 31870 80056470 0C015FE4 */  jal       alHeapAlloc
/* 31874 80056474 A200000C */   sb       $zero, 0xC($s0)
/* 31878 80056478 0260202D */  daddu     $a0, $s3, $zero
/* 3187C 8005647C 24050001 */  addiu     $a1, $zero, 0x1
/* 31880 80056480 24060014 */  addiu     $a2, $zero, 0x14
/* 31884 80056484 0C015FE4 */  jal       alHeapAlloc
/* 31888 80056488 AE020004 */   sw       $v0, 0x4($s0)
/* 3188C 8005648C 8E040004 */  lw        $a0, 0x4($s0)
/* 31890 80056490 9205000C */  lbu       $a1, 0xC($s0)
/* 31894 80056494 0260302D */  daddu     $a2, $s3, $zero
/* 31898 80056498 0C0163A1 */  jal       func_80058E84
/* 3189C 8005649C AE020008 */   sw       $v0, 0x8($s0)
/* 318A0 800564A0 8E040008 */  lw        $a0, 0x8($s0)
/* 318A4 800564A4 9205000C */  lbu       $a1, 0xC($s0)
/* 318A8 800564A8 0C0163A1 */  jal       func_80058E84
/* 318AC 800564AC 0260302D */   daddu    $a2, $s3, $zero
/* 318B0 800564B0 8EA20004 */  lw        $v0, 0x4($s5)
/* 318B4 800564B4 0222102A */  slt       $v0, $s1, $v0
/* 318B8 800564B8 1440FFE2 */  bnez      $v0, .L80056444
/* 318BC 800564BC 26520018 */   addiu    $s2, $s2, 0x18
.L800564C0:
/* 318C0 800564C0 0260202D */  daddu     $a0, $s3, $zero
/* 318C4 800564C4 24050170 */  addiu     $a1, $zero, 0x170
/* 318C8 800564C8 0C015FE4 */  jal       alHeapAlloc
/* 318CC 800564CC 24060002 */   addiu    $a2, $zero, 0x2
/* 318D0 800564D0 0260202D */  daddu     $a0, $s3, $zero
/* 318D4 800564D4 24050170 */  addiu     $a1, $zero, 0x170
/* 318D8 800564D8 24060002 */  addiu     $a2, $zero, 0x2
/* 318DC 800564DC 3C108008 */  lui       $s0, %hi(gSynDriverPtr)
/* 318E0 800564E0 26108E54 */  addiu     $s0, $s0, %lo(gSynDriverPtr)
/* 318E4 800564E4 8E030000 */  lw        $v1, 0x0($s0)
/* 318E8 800564E8 0000882D */  daddu     $s1, $zero, $zero
/* 318EC 800564EC 0C015FE4 */  jal       alHeapAlloc
/* 318F0 800564F0 AC620024 */   sw       $v0, 0x24($v1)
/* 318F4 800564F4 0260202D */  daddu     $a0, $s3, $zero
/* 318F8 800564F8 240502E0 */  addiu     $a1, $zero, 0x2E0
/* 318FC 800564FC 24060002 */  addiu     $a2, $zero, 0x2
/* 31900 80056500 3C01800A */  lui       $at, %hi(AuDelayedVoiceGroup)
/* 31904 80056504 A0203FEC */  sb        $zero, %lo(AuDelayedVoiceGroup)($at)
/* 31908 80056508 3C01800A */  lui       $at, %hi(AuDelayedChannel)
/* 3190C 8005650C A4203FEE */  sh        $zero, %lo(AuDelayedChannel)($at)
/* 31910 80056510 8E070000 */  lw        $a3, 0x0($s0)
/* 31914 80056514 24030004 */  addiu     $v1, $zero, 0x4
/* 31918 80056518 3C01800A */  lui       $at, %hi(AuDelayCount)
/* 3191C 8005651C AC233FF0 */  sw        $v1, %lo(AuDelayCount)($at)
/* 31920 80056520 0C015FE4 */  jal       alHeapAlloc
/* 31924 80056524 ACE20028 */   sw       $v0, 0x28($a3)
/* 31928 80056528 0260202D */  daddu     $a0, $s3, $zero
/* 3192C 8005652C 240502E0 */  addiu     $a1, $zero, 0x2E0
/* 31930 80056530 24060002 */  addiu     $a2, $zero, 0x2
/* 31934 80056534 3C10800A */  lui       $s0, %hi(AuDelayBufferMain)
/* 31938 80056538 26103FE0 */  addiu     $s0, $s0, %lo(AuDelayBufferMain)
/* 3193C 8005653C 0C015FE4 */  jal       alHeapAlloc
/* 31940 80056540 AE020000 */   sw       $v0, 0x0($s0)
/* 31944 80056544 8E100000 */  lw        $s0, 0x0($s0)
/* 31948 80056548 0040182D */  daddu     $v1, $v0, $zero
/* 3194C 8005654C 3C01800A */  lui       $at, %hi(AuDelayBufferAux)
/* 31950 80056550 AC233FE4 */  sw        $v1, %lo(AuDelayBufferAux)($at)
.L80056554:
/* 31954 80056554 A6000000 */  sh        $zero, 0x0($s0)
/* 31958 80056558 A4600000 */  sh        $zero, 0x0($v1)
/* 3195C 8005655C 24630002 */  addiu     $v1, $v1, 0x2
/* 31960 80056560 26310001 */  addiu     $s1, $s1, 0x1
/* 31964 80056564 2A2202E0 */  slti      $v0, $s1, 0x2E0
/* 31968 80056568 1440FFFA */  bnez      $v0, .L80056554
/* 3196C 8005656C 26100002 */   addiu    $s0, $s0, 0x2
/* 31970 80056570 3C028008 */  lui       $v0, %hi(gSynDriverPtr)
/* 31974 80056574 8C428E54 */  lw        $v0, %lo(gSynDriverPtr)($v0)
/* 31978 80056578 AC530018 */  sw        $s3, 0x18($v0)
.L8005657C:
/* 3197C 8005657C 8FBF002C */  lw        $ra, 0x2C($sp)
/* 31980 80056580 8FB60028 */  lw        $s6, 0x28($sp)
/* 31984 80056584 8FB50024 */  lw        $s5, 0x24($sp)
/* 31988 80056588 8FB40020 */  lw        $s4, 0x20($sp)
/* 3198C 8005658C 8FB3001C */  lw        $s3, 0x1C($sp)
/* 31990 80056590 8FB20018 */  lw        $s2, 0x18($sp)
/* 31994 80056594 8FB10014 */  lw        $s1, 0x14($sp)
/* 31998 80056598 8FB00010 */  lw        $s0, 0x10($sp)
/* 3199C 8005659C 03E00008 */  jr        $ra
/* 319A0 800565A0 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void au_driver_init(AuSynDriver* driver, ALConfig* config) {
    ALHeap* heap = config->heap;
    s32 i;

    if (gActiveSynDriverPtr != NULL) {
        return;
    }

    driver->num_pvoice = config->num_pvoice;
    driver->num_bus = config->num_bus;
    driver->curSamples = 0;
    driver->unk_04 = 0;
    driver->outputRate = config->outputRate;
    driver->dmaNew = config->dmaNew;

    gActiveSynDriverPtr = driver;
    gSynDriverPtr = driver;
    AuUseGlobalVolume = FALSE;
    AuGlobalVolume = 0x7FFF;
    AuSynStereoDirty = TRUE;

    gSynDriverPtr->pvoices = alHeapAlloc(heap, config->num_pvoice, sizeof(*gSynDriverPtr->pvoices));

    // this is inlined alN_PVoiceNew
    for (i = 0; i < config->num_pvoice; i++) {
        AuPVoice* voice = &gSynDriverPtr->pvoices[i];
        voice->decoder.state = alHeapAlloc(heap, 1, sizeof(*voice->decoder.state));
        voice->decoder.lstate = alHeapAlloc(heap, 1, sizeof(*voice->decoder.lstate));
        voice->decoder.dmaFunc = gSynDriverPtr->dmaNew(&voice->decoder.dmaState);
        voice->decoder.lastsam = 0;
        voice->decoder.first = 1;
        voice->decoder.memin = NULL;
        voice->resampler.state = alHeapAlloc(heap, 1, sizeof(*voice->resampler.state));
        voice->resampler.delta = 0;
        voice->resampler.first = 1;
        voice->resampler.ratio = 1.0f;
        voice->envMixer.state = alHeapAlloc(heap, 1, sizeof(*voice->envMixer.state));
        voice->envMixer.first = 1;
        voice->envMixer.motion = AL_STOPPED;
        voice->envMixer.volume = 1;
        voice->envMixer.ltgt = 1;
        voice->envMixer.rtgt = 1;
        voice->envMixer.cvolL = 1;
        voice->envMixer.cvolR = 1;
        voice->envMixer.dryamt = 0;
        voice->envMixer.wetamt = 0;
        voice->envMixer.lratm = 1;
        voice->envMixer.lratl = 0;
        voice->envMixer.rratm = 1;
        voice->envMixer.rratl = 0;
        voice->envMixer.delta = 0;
        voice->envMixer.segEnd = 0;
        voice->envMixer.pan = 64;
        voice->unk_74 = 0;
        voice->next = NULL;
        voice->busId = FX_BUS_BGMA_MAIN;
        voice->index = i;
    }

    gSynDriverPtr->fxBus = alHeapAlloc(heap, config->num_bus, sizeof(*gSynDriverPtr->fxBus));

    for (i = 0; i < config->num_bus; i++) {
        AuFxBus* fxBus = &gSynDriverPtr->fxBus[i];
        fxBus->head = NULL;
        fxBus->tail = NULL;
        fxBus->gain = 0x7FFF;
        fxBus->currentEffectType = AU_FX_NONE;
        fxBus->fxL = alHeapAlloc(heap, 1, sizeof(*fxBus->fxL));
        fxBus->fxR = alHeapAlloc(heap, 1, sizeof(*fxBus->fxR));
        func_80058E84(fxBus->fxL, fxBus->currentEffectType, heap);
        func_80058E84(fxBus->fxR, fxBus->currentEffectType, heap);
    }

    gSynDriverPtr->savedMainOut = alHeapAlloc(heap, 2 * AUDIO_SAMPLES, 2);
    gSynDriverPtr->savedAuxOut = alHeapAlloc(heap, 2 * AUDIO_SAMPLES, 2);
    AuDelayedVoiceGroup = 0;
    AuDelayedChannel = 0;
    AuDelayCount = 4;

    AuDelayBufferMain = alHeapAlloc(heap, 4 * AUDIO_SAMPLES, 2);
    AuDelayBufferAux = alHeapAlloc(heap, 4 * AUDIO_SAMPLES, 2);
    for (i = 0; i < 4 * AUDIO_SAMPLES; i++) {
        AuDelayBufferAux[i] = AuDelayBufferMain[i] = 0;
    }

    gSynDriverPtr->heap = heap;
}