### RAW ASSEMBLY INSTRUCTIONS:

glabel energy_orb_wave_appendGfx
/* 3A3E30 E00A4650 27BDFF28 */  addiu     $sp, $sp, -0xD8
/* 3A3E34 E00A4654 0080302D */  daddu     $a2, $a0, $zero
/* 3A3E38 E00A4658 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3A3E3C E00A465C 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3A3E40 E00A4660 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A3E44 E00A4664 AFB700BC */  sw        $s7, 0xBC($sp)
/* 3A3E48 E00A4668 3C170001 */  lui       $s7, (0x11630 >> 16)
/* 3A3E4C E00A466C 3C0AE300 */  lui       $t2, (0xE3001801 >> 16)
/* 3A3E50 E00A4670 AFB500B4 */  sw        $s5, 0xB4($sp)
/* 3A3E54 E00A4674 3C15800A */  lui       $s5, %hi(gMainGfxPos)
/* 3A3E58 E00A4678 26B5A66C */  addiu     $s5, $s5, %lo(gMainGfxPos)
/* 3A3E5C E00A467C AFBF00C4 */  sw        $ra, 0xC4($sp)
/* 3A3E60 E00A4680 AFBE00C0 */  sw        $fp, 0xC0($sp)
/* 3A3E64 E00A4684 AFB600B8 */  sw        $s6, 0xB8($sp)
/* 3A3E68 E00A4688 AFB400B0 */  sw        $s4, 0xB0($sp)
/* 3A3E6C E00A468C AFB300AC */  sw        $s3, 0xAC($sp)
/* 3A3E70 E00A4690 AFB200A8 */  sw        $s2, 0xA8($sp)
/* 3A3E74 E00A4694 AFB100A4 */  sw        $s1, 0xA4($sp)
/* 3A3E78 E00A4698 AFB000A0 */  sw        $s0, 0xA0($sp)
/* 3A3E7C E00A469C F7B600D0 */  sdc1      $f22, 0xD0($sp)
/* 3A3E80 E00A46A0 F7B400C8 */  sdc1      $f20, 0xC8($sp)
/* 3A3E84 E00A46A4 8EA50000 */  lw        $a1, 0x0($s5)
/* 3A3E88 E00A46A8 354A1801 */  ori       $t2, $t2, (0xE3001801 & 0xFFFF)
/* 3A3E8C E00A46AC AFAA009C */  sw        $t2, 0x9C($sp)
/* 3A3E90 E00A46B0 8CD2000C */  lw        $s2, 0xC($a2)
/* 3A3E94 E00A46B4 00A0182D */  daddu     $v1, $a1, $zero
/* 3A3E98 E00A46B8 24A50008 */  addiu     $a1, $a1, 0x8
/* 3A3E9C E00A46BC AEA50000 */  sw        $a1, 0x0($s5)
/* 3A3EA0 E00A46C0 8E4A0014 */  lw        $t2, 0x14($s2)
/* 3A3EA4 E00A46C4 36F71630 */  ori       $s7, $s7, (0x11630 & 0xFFFF)
/* 3A3EA8 E00A46C8 AFAA0098 */  sw        $t2, 0x98($sp)
/* 3A3EAC E00A46CC 8E53002C */  lw        $s3, 0x2C($s2)
/* 3A3EB0 E00A46D0 8E540000 */  lw        $s4, 0x0($s2)
/* 3A3EB4 E00A46D4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3A3EB8 E00A46D8 AC620000 */  sw        $v0, 0x0($v1)
/* 3A3EBC E00A46DC AC600004 */  sw        $zero, 0x4($v1)
/* 3A3EC0 E00A46E0 ACA70000 */  sw        $a3, 0x0($a1)
/* 3A3EC4 E00A46E4 8CC30010 */  lw        $v1, 0x10($a2)
/* 3A3EC8 E00A46E8 24A20008 */  addiu     $v0, $a1, 0x8
/* 3A3ECC E00A46EC AEA20000 */  sw        $v0, 0x0($s5)
/* 3A3ED0 E00A46F0 8C62001C */  lw        $v0, 0x1C($v1)
/* 3A3ED4 E00A46F4 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3A3ED8 E00A46F8 00431021 */  addu      $v0, $v0, $v1
/* 3A3EDC E00A46FC 3C03800B */  lui       $v1, %hi(gCameras)
/* 3A3EE0 E00A4700 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 3A3EE4 E00A4704 ACA20004 */  sw        $v0, 0x4($a1)
/* 3A3EE8 E00A4708 8E450004 */  lw        $a1, 0x4($s2)
/* 3A3EEC E00A470C 8E460008 */  lw        $a2, 0x8($s2)
/* 3A3EF0 E00A4710 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 3A3EF4 E00A4714 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 3A3EF8 E00A4718 8E47000C */  lw        $a3, 0xC($s2)
/* 3A3EFC E00A471C 00028080 */  sll       $s0, $v0, 2
/* 3A3F00 E00A4720 02028021 */  addu      $s0, $s0, $v0
/* 3A3F04 E00A4724 00108080 */  sll       $s0, $s0, 2
/* 3A3F08 E00A4728 02028023 */  subu      $s0, $s0, $v0
/* 3A3F0C E00A472C 001010C0 */  sll       $v0, $s0, 3
/* 3A3F10 E00A4730 02028021 */  addu      $s0, $s0, $v0
/* 3A3F14 E00A4734 001080C0 */  sll       $s0, $s0, 3
/* 3A3F18 E00A4738 0C080108 */  jal       shim_guTranslateF
/* 3A3F1C E00A473C 02038021 */   addu     $s0, $s0, $v1
/* 3A3F20 E00A4740 27B10058 */  addiu     $s1, $sp, 0x58
/* 3A3F24 E00A4744 8E450030 */  lw        $a1, 0x30($s2)
/* 3A3F28 E00A4748 0220202D */  daddu     $a0, $s1, $zero
/* 3A3F2C E00A474C 00A0302D */  daddu     $a2, $a1, $zero
/* 3A3F30 E00A4750 0C080110 */  jal       shim_guScaleF
/* 3A3F34 E00A4754 00A0382D */   daddu    $a3, $a1, $zero
/* 3A3F38 E00A4758 0220202D */  daddu     $a0, $s1, $zero
/* 3A3F3C E00A475C 27A50018 */  addiu     $a1, $sp, 0x18
/* 3A3F40 E00A4760 0C080114 */  jal       shim_guMtxCatF
/* 3A3F44 E00A4764 00A0302D */   daddu    $a2, $a1, $zero
/* 3A3F48 E00A4768 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A3F4C E00A476C 3C168007 */  lui       $s6, %hi(gMatrixListPos)
/* 3A3F50 E00A4770 26D641F0 */  addiu     $s6, $s6, %lo(gMatrixListPos)
/* 3A3F54 E00A4774 3C1E800A */  lui       $fp, %hi(gDisplayContext)
/* 3A3F58 E00A4778 27DEA674 */  addiu     $fp, $fp, %lo(gDisplayContext)
/* 3A3F5C E00A477C 96C50000 */  lhu       $a1, 0x0($s6)
/* 3A3F60 E00A4780 8FC20000 */  lw        $v0, 0x0($fp)
/* 3A3F64 E00A4784 00052980 */  sll       $a1, $a1, 6
/* 3A3F68 E00A4788 00B72821 */  addu      $a1, $a1, $s7
/* 3A3F6C E00A478C 0C080118 */  jal       shim_guMtxF2L
/* 3A3F70 E00A4790 00452821 */   addu     $a1, $v0, $a1
/* 3A3F74 E00A4794 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3A3F78 E00A4798 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3A3F7C E00A479C 3C05DA38 */  lui       $a1, (0xDA380001 >> 16)
/* 3A3F80 E00A47A0 34A50001 */  ori       $a1, $a1, (0xDA380001 & 0xFFFF)
/* 3A3F84 E00A47A4 3C06E300 */  lui       $a2, (0xE3001A01 >> 16)
/* 3A3F88 E00A47A8 34C61A01 */  ori       $a2, $a2, (0xE3001A01 & 0xFFFF)
/* 3A3F8C E00A47AC 327300FF */  andi      $s3, $s3, 0xFF
/* 3A3F90 E00A47B0 2A940003 */  slti      $s4, $s4, 0x3
/* 3A3F94 E00A47B4 8EA80000 */  lw        $t0, 0x0($s5)
/* 3A3F98 E00A47B8 96C20000 */  lhu       $v0, 0x0($s6)
/* 3A3F9C E00A47BC 0100202D */  daddu     $a0, $t0, $zero
/* 3A3FA0 E00A47C0 25080008 */  addiu     $t0, $t0, 0x8
/* 3A3FA4 E00A47C4 AEA80000 */  sw        $t0, 0x0($s5)
/* 3A3FA8 E00A47C8 AC830000 */  sw        $v1, 0x0($a0)
/* 3A3FAC E00A47CC 24430001 */  addiu     $v1, $v0, 0x1
/* 3A3FB0 E00A47D0 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3A3FB4 E00A47D4 00021180 */  sll       $v0, $v0, 6
/* 3A3FB8 E00A47D8 A6C30000 */  sh        $v1, 0x0($s6)
/* 3A3FBC E00A47DC 8FC30000 */  lw        $v1, 0x0($fp)
/* 3A3FC0 E00A47E0 00571021 */  addu      $v0, $v0, $s7
/* 3A3FC4 E00A47E4 00621821 */  addu      $v1, $v1, $v0
/* 3A3FC8 E00A47E8 25020008 */  addiu     $v0, $t0, 0x8
/* 3A3FCC E00A47EC AC830004 */  sw        $v1, 0x4($a0)
/* 3A3FD0 E00A47F0 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A3FD4 E00A47F4 25020010 */  addiu     $v0, $t0, 0x10
/* 3A3FD8 E00A47F8 AD050000 */  sw        $a1, 0x0($t0)
/* 3A3FDC E00A47FC AEA20000 */  sw        $v0, 0x0($s5)
/* 3A3FE0 E00A4800 8E030204 */  lw        $v1, 0x204($s0)
/* 3A3FE4 E00A4804 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3A3FE8 E00A4808 AD020008 */  sw        $v0, 0x8($t0)
/* 3A3FEC E00A480C AD030004 */  sw        $v1, 0x4($t0)
/* 3A3FF0 E00A4810 92430023 */  lbu       $v1, 0x23($s2)
/* 3A3FF4 E00A4814 92440027 */  lbu       $a0, 0x27($s2)
/* 3A3FF8 E00A4818 9245002B */  lbu       $a1, 0x2B($s2)
/* 3A3FFC E00A481C 25020018 */  addiu     $v0, $t0, 0x18
/* 3A4000 E00A4820 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4004 E00A4824 8FAA009C */  lw        $t2, 0x9C($sp)
/* 3A4008 E00A4828 25020020 */  addiu     $v0, $t0, 0x20
/* 3A400C E00A482C AD0A0010 */  sw        $t2, 0x10($t0)
/* 3A4010 E00A4830 240A0040 */  addiu     $t2, $zero, 0x40
/* 3A4014 E00A4834 00031E00 */  sll       $v1, $v1, 24
/* 3A4018 E00A4838 00042400 */  sll       $a0, $a0, 16
/* 3A401C E00A483C 00641825 */  or        $v1, $v1, $a0
/* 3A4020 E00A4840 00052A00 */  sll       $a1, $a1, 8
/* 3A4024 E00A4844 00651825 */  or        $v1, $v1, $a1
/* 3A4028 E00A4848 00731825 */  or        $v1, $v1, $s3
/* 3A402C E00A484C AD0A0014 */  sw        $t2, 0x14($t0)
/* 3A4030 E00A4850 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4034 E00A4854 AD060018 */  sw        $a2, 0x18($t0)
/* 3A4038 E00A4858 AD00001C */  sw        $zero, 0x1C($t0)
/* 3A403C E00A485C 12800068 */  beqz      $s4, .LE00A4A00
/* 3A4040 E00A4860 AD03000C */   sw       $v1, 0xC($t0)
/* 3A4044 E00A4864 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A4048 E00A4868 C7A00098 */  lwc1      $f0, 0x98($sp)
/* 3A404C E00A486C 46800020 */  cvt.s.w   $f0, $f0
/* 3A4050 E00A4870 3C12D838 */  lui       $s2, (0xD8380002 >> 16)
/* 3A4054 E00A4874 36520002 */  ori       $s2, $s2, (0xD8380002 & 0xFFFF)
/* 3A4058 E00A4878 25020028 */  addiu     $v0, $t0, 0x28
/* 3A405C E00A487C 44050000 */  mfc1      $a1, $f0
/* 3A4060 E00A4880 4480A000 */  mtc1      $zero, $f20
/* 3A4064 E00A4884 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3A4068 E00A4888 4481B000 */  mtc1      $at, $f22
/* 3A406C E00A488C 3C10DE00 */  lui       $s0, (0xDE000000 >> 16)
/* 3A4070 E00A4890 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4074 E00A4894 4406A000 */  mfc1      $a2, $f20
/* 3A4078 E00A4898 4407A000 */  mfc1      $a3, $f20
/* 3A407C E00A489C 3C020900 */  lui       $v0, %hi(D_09001000_40E290)
/* 3A4080 E00A48A0 24421000 */  addiu     $v0, $v0, %lo(D_09001000_40E290)
/* 3A4084 E00A48A4 AD100020 */  sw        $s0, 0x20($t0)
/* 3A4088 E00A48A8 AD020024 */  sw        $v0, 0x24($t0)
/* 3A408C E00A48AC 0C080104 */  jal       shim_guRotateF
/* 3A4090 E00A48B0 E7B60010 */   swc1     $f22, 0x10($sp)
/* 3A4094 E00A48B4 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A4098 E00A48B8 96C50000 */  lhu       $a1, 0x0($s6)
/* 3A409C E00A48BC 8FC20000 */  lw        $v0, 0x0($fp)
/* 3A40A0 E00A48C0 00052980 */  sll       $a1, $a1, 6
/* 3A40A4 E00A48C4 00B72821 */  addu      $a1, $a1, $s7
/* 3A40A8 E00A48C8 0C080118 */  jal       shim_guMtxF2L
/* 3A40AC E00A48CC 00452821 */   addu     $a1, $v0, $a1
/* 3A40B0 E00A48D0 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A40B4 E00A48D4 8FAA0098 */  lw        $t2, 0x98($sp)
/* 3A40B8 E00A48D8 8EA80000 */  lw        $t0, 0x0($s5)
/* 3A40BC E00A48DC 4406A000 */  mfc1      $a2, $f20
/* 3A40C0 E00A48E0 000A1023 */  negu      $v0, $t2
/* 3A40C4 E00A48E4 000210C0 */  sll       $v0, $v0, 3
/* 3A40C8 E00A48E8 44820000 */  mtc1      $v0, $f0
/* 3A40CC E00A48EC 00000000 */  nop
/* 3A40D0 E00A48F0 46800020 */  cvt.s.w   $f0, $f0
/* 3A40D4 E00A48F4 0100482D */  daddu     $t1, $t0, $zero
/* 3A40D8 E00A48F8 44050000 */  mfc1      $a1, $f0
/* 3A40DC E00A48FC 25080008 */  addiu     $t0, $t0, 0x8
/* 3A40E0 E00A4900 AEA80000 */  sw        $t0, 0x0($s5)
/* 3A40E4 E00A4904 96C20000 */  lhu       $v0, 0x0($s6)
/* 3A40E8 E00A4908 3C11DA38 */  lui       $s1, (0xDA380000 >> 16)
/* 3A40EC E00A490C AD310000 */  sw        $s1, 0x0($t1)
/* 3A40F0 E00A4910 24430001 */  addiu     $v1, $v0, 0x1
/* 3A40F4 E00A4914 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3A40F8 E00A4918 00021180 */  sll       $v0, $v0, 6
/* 3A40FC E00A491C A6C30000 */  sh        $v1, 0x0($s6)
/* 3A4100 E00A4920 8FC30000 */  lw        $v1, 0x0($fp)
/* 3A4104 E00A4924 00571021 */  addu      $v0, $v0, $s7
/* 3A4108 E00A4928 00621821 */  addu      $v1, $v1, $v0
/* 3A410C E00A492C 25020008 */  addiu     $v0, $t0, 0x8
/* 3A4110 E00A4930 AD230004 */  sw        $v1, 0x4($t1)
/* 3A4114 E00A4934 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4118 E00A4938 3C020900 */  lui       $v0, %hi(D_090011D0_40E460)
/* 3A411C E00A493C 244211D0 */  addiu     $v0, $v0, %lo(D_090011D0_40E460)
/* 3A4120 E00A4940 AD020004 */  sw        $v0, 0x4($t0)
/* 3A4124 E00A4944 25020010 */  addiu     $v0, $t0, 0x10
/* 3A4128 E00A4948 240A0040 */  addiu     $t2, $zero, 0x40
/* 3A412C E00A494C AD100000 */  sw        $s0, 0x0($t0)
/* 3A4130 E00A4950 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4134 E00A4954 25020018 */  addiu     $v0, $t0, 0x18
/* 3A4138 E00A4958 AD120008 */  sw        $s2, 0x8($t0)
/* 3A413C E00A495C AD0A000C */  sw        $t2, 0xC($t0)
/* 3A4140 E00A4960 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4144 E00A4964 8FAA009C */  lw        $t2, 0x9C($sp)
/* 3A4148 E00A4968 00C0382D */  daddu     $a3, $a2, $zero
/* 3A414C E00A496C AD0A0010 */  sw        $t2, 0x10($t0)
/* 3A4150 E00A4970 AD000014 */  sw        $zero, 0x14($t0)
/* 3A4154 E00A4974 0C080104 */  jal       shim_guRotateF
/* 3A4158 E00A4978 E7B60010 */   swc1     $f22, 0x10($sp)
/* 3A415C E00A497C 27A40018 */  addiu     $a0, $sp, 0x18
/* 3A4160 E00A4980 96C50000 */  lhu       $a1, 0x0($s6)
/* 3A4164 E00A4984 8FC20000 */  lw        $v0, 0x0($fp)
/* 3A4168 E00A4988 00052980 */  sll       $a1, $a1, 6
/* 3A416C E00A498C 00B72821 */  addu      $a1, $a1, $s7
/* 3A4170 E00A4990 0C080118 */  jal       shim_guMtxF2L
/* 3A4174 E00A4994 00452821 */   addu     $a1, $v0, $a1
/* 3A4178 E00A4998 8EA40000 */  lw        $a0, 0x0($s5)
/* 3A417C E00A499C 96C20000 */  lhu       $v0, 0x0($s6)
/* 3A4180 E00A49A0 0080282D */  daddu     $a1, $a0, $zero
/* 3A4184 E00A49A4 24840008 */  addiu     $a0, $a0, 0x8
/* 3A4188 E00A49A8 24430001 */  addiu     $v1, $v0, 0x1
/* 3A418C E00A49AC 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3A4190 E00A49B0 00021180 */  sll       $v0, $v0, 6
/* 3A4194 E00A49B4 AEA40000 */  sw        $a0, 0x0($s5)
/* 3A4198 E00A49B8 ACB10000 */  sw        $s1, 0x0($a1)
/* 3A419C E00A49BC A6C30000 */  sh        $v1, 0x0($s6)
/* 3A41A0 E00A49C0 8FC30000 */  lw        $v1, 0x0($fp)
/* 3A41A4 E00A49C4 00571021 */  addu      $v0, $v0, $s7
/* 3A41A8 E00A49C8 00621821 */  addu      $v1, $v1, $v0
/* 3A41AC E00A49CC 24820008 */  addiu     $v0, $a0, 0x8
/* 3A41B0 E00A49D0 ACA30004 */  sw        $v1, 0x4($a1)
/* 3A41B4 E00A49D4 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A41B8 E00A49D8 3C020900 */  lui       $v0, %hi(D_090011F0_40E480)
/* 3A41BC E00A49DC 244211F0 */  addiu     $v0, $v0, %lo(D_090011F0_40E480)
/* 3A41C0 E00A49E0 AC820004 */  sw        $v0, 0x4($a0)
/* 3A41C4 E00A49E4 24820010 */  addiu     $v0, $a0, 0x10
/* 3A41C8 E00A49E8 240A0040 */  addiu     $t2, $zero, 0x40
/* 3A41CC E00A49EC AC900000 */  sw        $s0, 0x0($a0)
/* 3A41D0 E00A49F0 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A41D4 E00A49F4 AC920008 */  sw        $s2, 0x8($a0)
/* 3A41D8 E00A49F8 0802928D */  j         .LE00A4A34
/* 3A41DC E00A49FC AC8A000C */   sw       $t2, 0xC($a0)
.LE00A4A00:
/* 3A41E0 E00A4A00 25020028 */  addiu     $v0, $t0, 0x28
/* 3A41E4 E00A4A04 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* 3A41E8 E00A4A08 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A41EC E00A4A0C 3C020900 */  lui       $v0, %hi(D_090010A8_40E338)
/* 3A41F0 E00A4A10 244210A8 */  addiu     $v0, $v0, %lo(D_090010A8_40E338)
/* 3A41F4 E00A4A14 AD020024 */  sw        $v0, 0x24($t0)
/* 3A41F8 E00A4A18 25020030 */  addiu     $v0, $t0, 0x30
/* 3A41FC E00A4A1C AD030020 */  sw        $v1, 0x20($t0)
/* 3A4200 E00A4A20 AEA20000 */  sw        $v0, 0x0($s5)
/* 3A4204 E00A4A24 3C020900 */  lui       $v0, %hi(D_09001210_40E4A0)
/* 3A4208 E00A4A28 24421210 */  addiu     $v0, $v0, %lo(D_09001210_40E4A0)
/* 3A420C E00A4A2C AD030028 */  sw        $v1, 0x28($t0)
/* 3A4210 E00A4A30 AD02002C */  sw        $v0, 0x2C($t0)
.LE00A4A34:
/* 3A4214 E00A4A34 3C02E300 */  lui       $v0, (0xE3001801 >> 16)
/* 3A4218 E00A4A38 34421801 */  ori       $v0, $v0, (0xE3001801 & 0xFFFF)
/* 3A421C E00A4A3C 3C06E300 */  lui       $a2, (0xE3001A01 >> 16)
/* 3A4220 E00A4A40 34C61A01 */  ori       $a2, $a2, (0xE3001A01 & 0xFFFF)
/* 3A4224 E00A4A44 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 3A4228 E00A4A48 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 3A422C E00A4A4C 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 3A4230 E00A4A50 8C830000 */  lw        $v1, 0x0($a0)
/* 3A4234 E00A4A54 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 3A4238 E00A4A58 0060282D */  daddu     $a1, $v1, $zero
/* 3A423C E00A4A5C 24630008 */  addiu     $v1, $v1, 0x8
/* 3A4240 E00A4A60 AC830000 */  sw        $v1, 0x0($a0)
/* 3A4244 E00A4A64 ACA20000 */  sw        $v0, 0x0($a1)
/* 3A4248 E00A4A68 240200C0 */  addiu     $v0, $zero, 0xC0
/* 3A424C E00A4A6C ACA20004 */  sw        $v0, 0x4($a1)
/* 3A4250 E00A4A70 24620008 */  addiu     $v0, $v1, 0x8
/* 3A4254 E00A4A74 AC820000 */  sw        $v0, 0x0($a0)
/* 3A4258 E00A4A78 24020030 */  addiu     $v0, $zero, 0x30
/* 3A425C E00A4A7C AC620004 */  sw        $v0, 0x4($v1)
/* 3A4260 E00A4A80 24620010 */  addiu     $v0, $v1, 0x10
/* 3A4264 E00A4A84 AC660000 */  sw        $a2, 0x0($v1)
/* 3A4268 E00A4A88 AC820000 */  sw        $v0, 0x0($a0)
/* 3A426C E00A4A8C 24020040 */  addiu     $v0, $zero, 0x40
/* 3A4270 E00A4A90 AC670008 */  sw        $a3, 0x8($v1)
/* 3A4274 E00A4A94 AC62000C */  sw        $v0, 0xC($v1)
/* 3A4278 E00A4A98 8FBF00C4 */  lw        $ra, 0xC4($sp)
/* 3A427C E00A4A9C 8FBE00C0 */  lw        $fp, 0xC0($sp)
/* 3A4280 E00A4AA0 8FB700BC */  lw        $s7, 0xBC($sp)
/* 3A4284 E00A4AA4 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 3A4288 E00A4AA8 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 3A428C E00A4AAC 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 3A4290 E00A4AB0 8FB300AC */  lw        $s3, 0xAC($sp)
/* 3A4294 E00A4AB4 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 3A4298 E00A4AB8 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 3A429C E00A4ABC 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 3A42A0 E00A4AC0 D7B600D0 */  ldc1      $f22, 0xD0($sp)
/* 3A42A4 E00A4AC4 D7B400C8 */  ldc1      $f20, 0xC8($sp)
/* 3A42A8 E00A4AC8 03E00008 */  jr        $ra
/* 3A42AC E00A4ACC 27BD00D8 */   addiu    $sp, $sp, 0xD8

### DECOMPILED C INSTRUCTIONS:

void energy_orb_wave_appendGfx(void* effect) {
    EnergyOrbWaveFXData* data = ((EffectInstance*)effect)->data.energyOrbWave;
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 unk_14 = data->unk_14;
    s32 unk_2C = data->unk_2C;
    s32 unk_00 = data->unk_00;
    Matrix4f sp18;
    Matrix4f sp58;

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

    shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
    shim_guScaleF(sp58, data->scale, data->scale, data->scale);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_20, data->unk_24, data->unk_28, unk_2C);
    gDPSetColorDither(gMainGfxPos++, G_CD_BAYER);
    gDPSetAlphaDither(gMainGfxPos++, G_AD_PATTERN);

    if (unk_00 < 3) {
        gSPDisplayList(gMainGfxPos++, D_09001000_3A5320);

        shim_guRotateF(sp18, unk_14, 0.0f, 0.0f, 1.0f);
        shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, D_090011D0_3A54F0);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ);

        shim_guRotateF(sp18, -unk_14 * 8, 0.0f, 0.0f, 1.0f);
        shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, D_090011F0_3A5510);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    } else {
        gSPDisplayList(gMainGfxPos++, D_090010A8_3A53C8);
        gSPDisplayList(gMainGfxPos++, D_09001210_3A5530);
    }

    gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
    gDPSetAlphaDither(gMainGfxPos++, G_AD_DISABLE);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel star_spirits_energy_appendGfx
/* 40CCAC E012270C 27BDFF70 */  addiu     $sp, $sp, -0x90
/* 40CCB0 E0122710 0080402D */  daddu     $t0, $a0, $zero
/* 40CCB4 E0122714 3C09DB06 */  lui       $t1, (0xDB060024 >> 16)
/* 40CCB8 E0122718 35290024 */  ori       $t1, $t1, (0xDB060024 & 0xFFFF)
/* 40CCBC E012271C 27A40020 */  addiu     $a0, $sp, 0x20
/* 40CCC0 E0122720 AFB00060 */  sw        $s0, 0x60($sp)
/* 40CCC4 E0122724 3C100001 */  lui       $s0, (0x11630 >> 16)
/* 40CCC8 E0122728 36101630 */  ori       $s0, $s0, (0x11630 & 0xFFFF)
/* 40CCCC E012272C AFB40070 */  sw        $s4, 0x70($sp)
/* 40CCD0 E0122730 0000A02D */  daddu     $s4, $zero, $zero
/* 40CCD4 E0122734 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 40CCD8 E0122738 2442A674 */  addiu     $v0, $v0, %lo(gDisplayContext)
/* 40CCDC E012273C AFBE0080 */  sw        $fp, 0x80($sp)
/* 40CCE0 E0122740 0040F02D */  daddu     $fp, $v0, $zero
/* 40CCE4 E0122744 3C028007 */  lui       $v0, %hi(gMatrixListPos)
/* 40CCE8 E0122748 244241F0 */  addiu     $v0, $v0, %lo(gMatrixListPos)
/* 40CCEC E012274C AFB50074 */  sw        $s5, 0x74($sp)
/* 40CCF0 E0122750 0040A82D */  daddu     $s5, $v0, $zero
/* 40CCF4 E0122754 3C02800A */  lui       $v0, %hi(gMainGfxPos)
/* 40CCF8 E0122758 2442A66C */  addiu     $v0, $v0, %lo(gMainGfxPos)
/* 40CCFC E012275C AFB3006C */  sw        $s3, 0x6C($sp)
/* 40CD00 E0122760 0040982D */  daddu     $s3, $v0, $zero
/* 40CD04 E0122764 AFBF0084 */  sw        $ra, 0x84($sp)
/* 40CD08 E0122768 AFB7007C */  sw        $s7, 0x7C($sp)
/* 40CD0C E012276C AFB60078 */  sw        $s6, 0x78($sp)
/* 40CD10 E0122770 AFB20068 */  sw        $s2, 0x68($sp)
/* 40CD14 E0122774 AFB10064 */  sw        $s1, 0x64($sp)
/* 40CD18 E0122778 F7B40088 */  sdc1      $f20, 0x88($sp)
/* 40CD1C E012277C 8C460000 */  lw        $a2, 0x0($v0)
/* 40CD20 E0122780 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 40CD24 E0122784 44800000 */  mtc1      $zero, $f0
/* 40CD28 E0122788 8D11000C */  lw        $s1, 0xC($t0)
/* 40CD2C E012278C 00C0182D */  daddu     $v1, $a2, $zero
/* 40CD30 E0122790 8E370004 */  lw        $s7, 0x4($s1)
/* 40CD34 E0122794 24C60008 */  addiu     $a2, $a2, 0x8
/* 40CD38 E0122798 AC620000 */  sw        $v0, 0x0($v1)
/* 40CD3C E012279C AC600004 */  sw        $zero, 0x4($v1)
/* 40CD40 E01227A0 ACC90000 */  sw        $t1, 0x0($a2)
/* 40CD44 E01227A4 8D020010 */  lw        $v0, 0x10($t0)
/* 40CD48 E01227A8 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 40CD4C E01227AC 44050000 */  mfc1      $a1, $f0
/* 40CD50 E01227B0 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 40CD54 E01227B4 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 40CD58 E01227B8 8C42001C */  lw        $v0, 0x1C($v0)
/* 40CD5C E01227BC 4485A000 */  mtc1      $a1, $f20
/* 40CD60 E01227C0 00481021 */  addu      $v0, $v0, $t0
/* 40CD64 E01227C4 ACC20004 */  sw        $v0, 0x4($a2)
/* 40CD68 E01227C8 00031080 */  sll       $v0, $v1, 2
/* 40CD6C E01227CC 00431021 */  addu      $v0, $v0, $v1
/* 40CD70 E01227D0 00021080 */  sll       $v0, $v0, 2
/* 40CD74 E01227D4 00431023 */  subu      $v0, $v0, $v1
/* 40CD78 E01227D8 000218C0 */  sll       $v1, $v0, 3
/* 40CD7C E01227DC 00431021 */  addu      $v0, $v0, $v1
/* 40CD80 E01227E0 000210C0 */  sll       $v0, $v0, 3
/* 40CD84 E01227E4 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 40CD88 E01227E8 00220821 */  addu      $at, $at, $v0
/* 40CD8C E01227EC C4221DEC */  lwc1      $f2, %lo(gCameras + 0x6C)($at)
/* 40CD90 E01227F0 C620003C */  lwc1      $f0, 0x3C($s1)
/* 40CD94 E01227F4 3C160001 */  lui       $s6, (0x11630 >> 16)
/* 40CD98 E01227F8 E7A00010 */  swc1      $f0, 0x10($sp)
/* 40CD9C E01227FC C6200008 */  lwc1      $f0, 0x8($s1)
/* 40CDA0 E0122800 36D61630 */  ori       $s6, $s6, (0x11630 & 0xFFFF)
/* 40CDA4 E0122804 AE660000 */  sw        $a2, 0x0($s3)
/* 40CDA8 E0122808 24C60008 */  addiu     $a2, $a2, 0x8
/* 40CDAC E012280C E7A00014 */  swc1      $f0, 0x14($sp)
/* 40CDB0 E0122810 C620000C */  lwc1      $f0, 0xC($s1)
/* 40CDB4 E0122814 46001087 */  neg.s     $f2, $f2
/* 40CDB8 E0122818 AE660000 */  sw        $a2, 0x0($s3)
/* 40CDBC E012281C 44061000 */  mfc1      $a2, $f2
/* 40CDC0 E0122820 0220902D */  daddu     $s2, $s1, $zero
/* 40CDC4 E0122824 E7A00018 */  swc1      $f0, 0x18($sp)
/* 40CDC8 E0122828 C6200010 */  lwc1      $f0, 0x10($s1)
/* 40CDCC E012282C 00A0382D */  daddu     $a3, $a1, $zero
/* 40CDD0 E0122830 0C080180 */  jal       shim_guPositionF
/* 40CDD4 E0122834 E7A0001C */   swc1     $f0, 0x1C($sp)
/* 40CDD8 E0122838 27A40020 */  addiu     $a0, $sp, 0x20
/* 40CDDC E012283C 96A50000 */  lhu       $a1, 0x0($s5)
/* 40CDE0 E0122840 8FC20000 */  lw        $v0, 0x0($fp)
/* 40CDE4 E0122844 00052980 */  sll       $a1, $a1, 6
/* 40CDE8 E0122848 00B02821 */  addu      $a1, $a1, $s0
/* 40CDEC E012284C 0C080118 */  jal       shim_guMtxF2L
/* 40CDF0 E0122850 00452821 */   addu     $a1, $v0, $a1
/* 40CDF4 E0122854 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 40CDF8 E0122858 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 40CDFC E012285C 8E650000 */  lw        $a1, 0x0($s3)
/* 40CE00 E0122860 96A20000 */  lhu       $v0, 0x0($s5)
/* 40CE04 E0122864 00A0202D */  daddu     $a0, $a1, $zero
/* 40CE08 E0122868 24A50008 */  addiu     $a1, $a1, 0x8
/* 40CE0C E012286C AE650000 */  sw        $a1, 0x0($s3)
/* 40CE10 E0122870 AC830000 */  sw        $v1, 0x0($a0)
/* 40CE14 E0122874 24430001 */  addiu     $v1, $v0, 0x1
/* 40CE18 E0122878 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 40CE1C E012287C 00021180 */  sll       $v0, $v0, 6
/* 40CE20 E0122880 A6A30000 */  sh        $v1, 0x0($s5)
/* 40CE24 E0122884 8FC30000 */  lw        $v1, 0x0($fp)
/* 40CE28 E0122888 00501021 */  addu      $v0, $v0, $s0
/* 40CE2C E012288C 00621821 */  addu      $v1, $v1, $v0
/* 40CE30 E0122890 24A20008 */  addiu     $v0, $a1, 0x8
/* 40CE34 E0122894 AC830004 */  sw        $v1, 0x4($a0)
/* 40CE38 E0122898 AE620000 */  sw        $v0, 0x0($s3)
/* 40CE3C E012289C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 40CE40 E01228A0 ACA20000 */  sw        $v0, 0x0($a1)
/* 40CE44 E01228A4 24A20010 */  addiu     $v0, $a1, 0x10
/* 40CE48 E01228A8 AE620000 */  sw        $v0, 0x0($s3)
/* 40CE4C E01228AC 3C03E012 */  lui       $v1, (0xE0122BA4 >> 16)
/* 40CE50 E01228B0 8C632BA4 */  lw        $v1, (0xE0122BA4 & 0xFFFF)($v1)
/* 40CE54 E01228B4 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 40CE58 E01228B8 ACA20008 */  sw        $v0, 0x8($a1)
/* 40CE5C E01228BC ACA30004 */  sw        $v1, 0x4($a1)
/* 40CE60 E01228C0 9222002F */  lbu       $v0, 0x2F($s1)
/* 40CE64 E01228C4 92230033 */  lbu       $v1, 0x33($s1)
/* 40CE68 E01228C8 92240037 */  lbu       $a0, 0x37($s1)
/* 40CE6C E01228CC 00021600 */  sll       $v0, $v0, 24
/* 40CE70 E01228D0 00031C00 */  sll       $v1, $v1, 16
/* 40CE74 E01228D4 00431025 */  or        $v0, $v0, $v1
/* 40CE78 E01228D8 00042200 */  sll       $a0, $a0, 8
/* 40CE7C E01228DC 9223003B */  lbu       $v1, 0x3B($s1)
/* 40CE80 E01228E0 00441025 */  or        $v0, $v0, $a0
/* 40CE84 E01228E4 00431025 */  or        $v0, $v0, $v1
/* 40CE88 E01228E8 ACA2000C */  sw        $v0, 0xC($a1)
.LE01228EC:
/* 40CE8C E01228EC 24020001 */  addiu     $v0, $zero, 0x1
/* 40CE90 E01228F0 16E20003 */  bne       $s7, $v0, .LE0122900
/* 40CE94 E01228F4 24020002 */   addiu    $v0, $zero, 0x2
/* 40CE98 E01228F8 52820047 */  beql      $s4, $v0, .LE0122A18
/* 40CE9C E01228FC 26940001 */   addiu    $s4, $s4, 0x1
.LE0122900:
/* 40CEA0 E0122900 C6400040 */  lwc1      $f0, 0x40($s2)
/* 40CEA4 E0122904 46140032 */  c.eq.s    $f0, $f20
/* 40CEA8 E0122908 00000000 */  nop
/* 40CEAC E012290C 45010041 */  bc1t      .LE0122A14
/* 40CEB0 E0122910 00148080 */   sll      $s0, $s4, 2
/* 40CEB4 E0122914 8E420050 */  lw        $v0, 0x50($s2)
/* 40CEB8 E0122918 5040003F */  beql      $v0, $zero, .LE0122A18
/* 40CEBC E012291C 26940001 */   addiu    $s4, $s4, 0x1
/* 40CEC0 E0122920 4405A000 */  mfc1      $a1, $f20
/* 40CEC4 E0122924 4406A000 */  mfc1      $a2, $f20
/* 40CEC8 E0122928 4407A000 */  mfc1      $a3, $f20
/* 40CECC E012292C 27A40020 */  addiu     $a0, $sp, 0x20
/* 40CED0 E0122930 E7A00010 */  swc1      $f0, 0x10($sp)
/* 40CED4 E0122934 E7B40014 */  swc1      $f20, 0x14($sp)
/* 40CED8 E0122938 E7B40018 */  swc1      $f20, 0x18($sp)
/* 40CEDC E012293C 0C080180 */  jal       shim_guPositionF
/* 40CEE0 E0122940 E7B4001C */   swc1     $f20, 0x1C($sp)
/* 40CEE4 E0122944 27A40020 */  addiu     $a0, $sp, 0x20
/* 40CEE8 E0122948 96A50000 */  lhu       $a1, 0x0($s5)
/* 40CEEC E012294C 8FC20000 */  lw        $v0, 0x0($fp)
/* 40CEF0 E0122950 00052980 */  sll       $a1, $a1, 6
/* 40CEF4 E0122954 00B62821 */  addu      $a1, $a1, $s6
/* 40CEF8 E0122958 0C080118 */  jal       shim_guMtxF2L
/* 40CEFC E012295C 00452821 */   addu     $a1, $v0, $a1
/* 40CF00 E0122960 3C08D838 */  lui       $t0, (0xD8380002 >> 16)
/* 40CF04 E0122964 8E640000 */  lw        $a0, 0x0($s3)
/* 40CF08 E0122968 35080002 */  ori       $t0, $t0, (0xD8380002 & 0xFFFF)
/* 40CF0C E012296C 0080282D */  daddu     $a1, $a0, $zero
/* 40CF10 E0122970 24840008 */  addiu     $a0, $a0, 0x8
/* 40CF14 E0122974 AE640000 */  sw        $a0, 0x0($s3)
/* 40CF18 E0122978 96A20000 */  lhu       $v0, 0x0($s5)
/* 40CF1C E012297C 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 40CF20 E0122980 ACA30000 */  sw        $v1, 0x0($a1)
/* 40CF24 E0122984 24430001 */  addiu     $v1, $v0, 0x1
/* 40CF28 E0122988 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 40CF2C E012298C 00021180 */  sll       $v0, $v0, 6
/* 40CF30 E0122990 A6A30000 */  sh        $v1, 0x0($s5)
/* 40CF34 E0122994 8FC30000 */  lw        $v1, 0x0($fp)
/* 40CF38 E0122998 00561021 */  addu      $v0, $v0, $s6
/* 40CF3C E012299C 00621821 */  addu      $v1, $v1, $v0
/* 40CF40 E01229A0 24820008 */  addiu     $v0, $a0, 0x8
/* 40CF44 E01229A4 ACA30004 */  sw        $v1, 0x4($a1)
/* 40CF48 E01229A8 AE620000 */  sw        $v0, 0x0($s3)
/* 40CF4C E01229AC 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 40CF50 E01229B0 AC820000 */  sw        $v0, 0x0($a0)
/* 40CF54 E01229B4 9223001F */  lbu       $v1, 0x1F($s1)
/* 40CF58 E01229B8 92250023 */  lbu       $a1, 0x23($s1)
/* 40CF5C E01229BC 92260027 */  lbu       $a2, 0x27($s1)
/* 40CF60 E01229C0 92470053 */  lbu       $a3, 0x53($s2)
/* 40CF64 E01229C4 24820010 */  addiu     $v0, $a0, 0x10
/* 40CF68 E01229C8 AE620000 */  sw        $v0, 0x0($s3)
/* 40CF6C E01229CC 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 40CF70 E01229D0 AC820008 */  sw        $v0, 0x8($a0)
/* 40CF74 E01229D4 00031E00 */  sll       $v1, $v1, 24
/* 40CF78 E01229D8 00052C00 */  sll       $a1, $a1, 16
/* 40CF7C E01229DC 00651825 */  or        $v1, $v1, $a1
/* 40CF80 E01229E0 00063200 */  sll       $a2, $a2, 8
/* 40CF84 E01229E4 00661825 */  or        $v1, $v1, $a2
/* 40CF88 E01229E8 00671825 */  or        $v1, $v1, $a3
/* 40CF8C E01229EC AC830004 */  sw        $v1, 0x4($a0)
/* 40CF90 E01229F0 3C03E012 */  lui       $v1, (0xE0122B90 >> 16)
/* 40CF94 E01229F4 00701821 */  addu      $v1, $v1, $s0
/* 40CF98 E01229F8 8C632B90 */  lw        $v1, (0xE0122B90 & 0xFFFF)($v1)
/* 40CF9C E01229FC 24820018 */  addiu     $v0, $a0, 0x18
/* 40CFA0 E0122A00 AE620000 */  sw        $v0, 0x0($s3)
/* 40CFA4 E0122A04 24020040 */  addiu     $v0, $zero, 0x40
/* 40CFA8 E0122A08 AC880010 */  sw        $t0, 0x10($a0)
/* 40CFAC E0122A0C AC820014 */  sw        $v0, 0x14($a0)
/* 40CFB0 E0122A10 AC83000C */  sw        $v1, 0xC($a0)
.LE0122A14:
/* 40CFB4 E0122A14 26940001 */  addiu     $s4, $s4, 0x1
.LE0122A18:
/* 40CFB8 E0122A18 2A820004 */  slti      $v0, $s4, 0x4
/* 40CFBC E0122A1C 1440FFB3 */  bnez      $v0, .LE01228EC
/* 40CFC0 E0122A20 26520004 */   addiu    $s2, $s2, 0x4
/* 40CFC4 E0122A24 3C05D838 */  lui       $a1, (0xD8380002 >> 16)
/* 40CFC8 E0122A28 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 40CFCC E0122A2C 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 40CFD0 E0122A30 8C620000 */  lw        $v0, 0x0($v1)
/* 40CFD4 E0122A34 34A50002 */  ori       $a1, $a1, (0xD8380002 & 0xFFFF)
/* 40CFD8 E0122A38 0040202D */  daddu     $a0, $v0, $zero
/* 40CFDC E0122A3C 24420008 */  addiu     $v0, $v0, 0x8
/* 40CFE0 E0122A40 AC620000 */  sw        $v0, 0x0($v1)
/* 40CFE4 E0122A44 24020040 */  addiu     $v0, $zero, 0x40
/* 40CFE8 E0122A48 AC820004 */  sw        $v0, 0x4($a0)
/* 40CFEC E0122A4C 26E2FFFE */  addiu     $v0, $s7, -0x2
/* 40CFF0 E0122A50 2C420002 */  sltiu     $v0, $v0, 0x2
/* 40CFF4 E0122A54 10400037 */  beqz      $v0, .LE0122B34
/* 40CFF8 E0122A58 AC850000 */   sw       $a1, 0x0($a0)
/* 40CFFC E0122A5C 8E230070 */  lw        $v1, 0x70($s1)
/* 40D000 E0122A60 24020001 */  addiu     $v0, $zero, 0x1
/* 40D004 E0122A64 10620004 */  beq       $v1, $v0, .LE0122A78
/* 40D008 E0122A68 0000382D */   daddu    $a3, $zero, $zero
/* 40D00C E0122A6C 24020064 */  addiu     $v0, $zero, 0x64
/* 40D010 E0122A70 1462000E */  bne       $v1, $v0, .LE0122AAC
/* 40D014 E0122A74 24020005 */   addiu    $v0, $zero, 0x5
.LE0122A78:
/* 40D018 E0122A78 8E230074 */  lw        $v1, 0x74($s1)
/* 40D01C E0122A7C 28620003 */  slti      $v0, $v1, 0x3
/* 40D020 E0122A80 14400008 */  bnez      $v0, .LE0122AA4
/* 40D024 E0122A84 2862000B */   slti     $v0, $v1, 0xB
/* 40D028 E0122A88 10400006 */  beqz      $v0, .LE0122AA4
/* 40D02C E0122A8C 2462FFFE */   addiu    $v0, $v1, -0x2
/* 40D030 E0122A90 00021900 */  sll       $v1, $v0, 4
/* 40D034 E0122A94 00621823 */  subu      $v1, $v1, $v0
/* 40D038 E0122A98 00031840 */  sll       $v1, $v1, 1
/* 40D03C E0122A9C 240200FF */  addiu     $v0, $zero, 0xFF
/* 40D040 E0122AA0 00433823 */  subu      $a3, $v0, $v1
.LE0122AA4:
/* 40D044 E0122AA4 8E230070 */  lw        $v1, 0x70($s1)
/* 40D048 E0122AA8 24020005 */  addiu     $v0, $zero, 0x5
.LE0122AAC:
/* 40D04C E0122AAC 1462000A */  bne       $v1, $v0, .LE0122AD8
/* 40D050 E0122AB0 00000000 */   nop
/* 40D054 E0122AB4 8E230074 */  lw        $v1, 0x74($s1)
/* 40D058 E0122AB8 18600007 */  blez      $v1, .LE0122AD8
/* 40D05C E0122ABC 28620009 */   slti     $v0, $v1, 0x9
/* 40D060 E0122AC0 10400005 */  beqz      $v0, .LE0122AD8
/* 40D064 E0122AC4 00031100 */   sll      $v0, $v1, 4
/* 40D068 E0122AC8 00431023 */  subu      $v0, $v0, $v1
/* 40D06C E0122ACC 00021040 */  sll       $v0, $v0, 1
/* 40D070 E0122AD0 240300FF */  addiu     $v1, $zero, 0xFF
/* 40D074 E0122AD4 00623823 */  subu      $a3, $v1, $v0
.LE0122AD8:
/* 40D078 E0122AD8 18E00014 */  blez      $a3, .LE0122B2C
/* 40D07C E0122ADC 3C06D0D0 */   lui      $a2, (0xD0D0D000 >> 16)
/* 40D080 E0122AE0 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 40D084 E0122AE4 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 40D088 E0122AE8 34C6D000 */  ori       $a2, $a2, (0xD0D0D000 & 0xFFFF)
/* 40D08C E0122AEC 8CA30000 */  lw        $v1, 0x0($a1)
/* 40D090 E0122AF0 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 40D094 E0122AF4 0060202D */  daddu     $a0, $v1, $zero
/* 40D098 E0122AF8 24630008 */  addiu     $v1, $v1, 0x8
/* 40D09C E0122AFC ACA30000 */  sw        $v1, 0x0($a1)
/* 40D0A0 E0122B00 AC820000 */  sw        $v0, 0x0($a0)
/* 40D0A4 E0122B04 30E200FF */  andi      $v0, $a3, 0xFF
/* 40D0A8 E0122B08 00461025 */  or        $v0, $v0, $a2
/* 40D0AC E0122B0C AC820004 */  sw        $v0, 0x4($a0)
/* 40D0B0 E0122B10 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 40D0B4 E0122B14 AC620000 */  sw        $v0, 0x0($v1)
/* 40D0B8 E0122B18 3C04E012 */  lui       $a0, (0xE0122BA0 >> 16)
/* 40D0BC E0122B1C 8C842BA0 */  lw        $a0, (0xE0122BA0 & 0xFFFF)($a0)
/* 40D0C0 E0122B20 24620008 */  addiu     $v0, $v1, 0x8
/* 40D0C4 E0122B24 ACA20000 */  sw        $v0, 0x0($a1)
/* 40D0C8 E0122B28 AC640004 */  sw        $a0, 0x4($v1)
.LE0122B2C:
/* 40D0CC E0122B2C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 40D0D0 E0122B30 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
.LE0122B34:
/* 40D0D4 E0122B34 8C620000 */  lw        $v0, 0x0($v1)
/* 40D0D8 E0122B38 0040202D */  daddu     $a0, $v0, $zero
/* 40D0DC E0122B3C 24420008 */  addiu     $v0, $v0, 0x8
/* 40D0E0 E0122B40 AC620000 */  sw        $v0, 0x0($v1)
/* 40D0E4 E0122B44 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 40D0E8 E0122B48 AC820000 */  sw        $v0, 0x0($a0)
/* 40D0EC E0122B4C AC800004 */  sw        $zero, 0x4($a0)
/* 40D0F0 E0122B50 8FBF0084 */  lw        $ra, 0x84($sp)
/* 40D0F4 E0122B54 8FBE0080 */  lw        $fp, 0x80($sp)
/* 40D0F8 E0122B58 8FB7007C */  lw        $s7, 0x7C($sp)
/* 40D0FC E0122B5C 8FB60078 */  lw        $s6, 0x78($sp)
/* 40D100 E0122B60 8FB50074 */  lw        $s5, 0x74($sp)
/* 40D104 E0122B64 8FB40070 */  lw        $s4, 0x70($sp)
/* 40D108 E0122B68 8FB3006C */  lw        $s3, 0x6C($sp)
/* 40D10C E0122B6C 8FB20068 */  lw        $s2, 0x68($sp)
/* 40D110 E0122B70 8FB10064 */  lw        $s1, 0x64($sp)
/* 40D114 E0122B74 8FB00060 */  lw        $s0, 0x60($sp)
/* 40D118 E0122B78 D7B40088 */  ldc1      $f20, 0x88($sp)
/* 40D11C E0122B7C 03E00008 */  jr        $ra
/* 40D120 E0122B80 27BD0090 */   addiu    $sp, $sp, 0x90
/* 40D124 E0122B84 00000000 */  nop
/* 40D128 E0122B88 00000000 */  nop
/* 40D12C E0122B8C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void star_spirits_energy_appendGfx(void* effect) {
    StarSpiritsEnergyFXData* data = ((EffectInstance*)effect)->data.starSpiritsEnergy;
    s32 unk_04 = data->unk_04;
    s32 alpha;
    Matrix4f sp20;
    s32 i;

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

    shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f,
                     data->unk_3C, data->unk_08, data->unk_0C, data->unk_10);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
              G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPDisplayList(gMainGfxPos++, D_E0122BA4[0]);
    gDPSetEnvColor(gMainGfxPos++, data->unk_2C, data->unk_30, data->unk_34, data->unk_38);

    for (i = 0; i < 4; i++) {
        if (unk_04 != 1 || i != 2) {
            if (data->unk_40[i] != 0.0f && data->unk_50[i] != 0) {
                shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, data->unk_40[i], 0.0f, 0.0f, 0.0f);
                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->unk_1C, data->unk_20, data->unk_24, data->unk_50[i]);
                gSPDisplayList(gMainGfxPos++, D_E0122B90[i]);
                gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
            }
        }
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);

    if (unk_04 == 2 || unk_04 == 3) {
        alpha = 0;

        if ((data->unk_70 == 1 || data->unk_70 == 100) && data->unk_74 > 2 && data->unk_74 < 11) {
            alpha = 255 - (data->unk_74 - 2) * 30;
        }

        if (data->unk_70 == 5 && data->unk_74 > 0 && data->unk_74 < 9) {
            alpha = 255 - data->unk_74 * 30;
        }

        if (alpha > 0) {
            gDPSetPrimColor(gMainGfxPos++, 0, 0, 208, 208, 208, alpha);
            gSPDisplayList(gMainGfxPos++, D_E0122BA0[0]);
        }
    }

    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel lens_flare_appendGfx
/* 344D20 E0034310 27BDFEE8 */  addiu     $sp, $sp, -0x118
/* 344D24 E0034314 3C03DB06 */  lui       $v1, (0xDB060024 >> 16)
/* 344D28 E0034318 AFB600F8 */  sw        $s6, 0xF8($sp)
/* 344D2C E003431C 3C16800A */  lui       $s6, %hi(gMainGfxPos)
/* 344D30 E0034320 26D6A66C */  addiu     $s6, $s6, %lo(gMainGfxPos)
/* 344D34 E0034324 34630024 */  ori       $v1, $v1, (0xDB060024 & 0xFFFF)
/* 344D38 E0034328 AFBF0104 */  sw        $ra, 0x104($sp)
/* 344D3C E003432C AFBE0100 */  sw        $fp, 0x100($sp)
/* 344D40 E0034330 AFB700FC */  sw        $s7, 0xFC($sp)
/* 344D44 E0034334 AFB500F4 */  sw        $s5, 0xF4($sp)
/* 344D48 E0034338 AFB400F0 */  sw        $s4, 0xF0($sp)
/* 344D4C E003433C AFB300EC */  sw        $s3, 0xEC($sp)
/* 344D50 E0034340 AFB200E8 */  sw        $s2, 0xE8($sp)
/* 344D54 E0034344 AFB100E4 */  sw        $s1, 0xE4($sp)
/* 344D58 E0034348 AFB000E0 */  sw        $s0, 0xE0($sp)
/* 344D5C E003434C F7B60110 */  sdc1      $f22, 0x110($sp)
/* 344D60 E0034350 F7B40108 */  sdc1      $f20, 0x108($sp)
/* 344D64 E0034354 8EC80000 */  lw        $t0, 0x0($s6)
/* 344D68 E0034358 8C94000C */  lw        $s4, 0xC($a0)
/* 344D6C E003435C 0100102D */  daddu     $v0, $t0, $zero
/* 344D70 E0034360 25080008 */  addiu     $t0, $t0, 0x8
/* 344D74 E0034364 8E900000 */  lw        $s0, 0x0($s4)
/* 344D78 E0034368 3C0BE700 */  lui       $t3, (0xE7000000 >> 16)
/* 344D7C E003436C AC4B0000 */  sw        $t3, 0x0($v0)
/* 344D80 E0034370 AC400004 */  sw        $zero, 0x4($v0)
/* 344D84 E0034374 AD030000 */  sw        $v1, 0x0($t0)
/* 344D88 E0034378 8C820010 */  lw        $v0, 0x10($a0)
/* 344D8C E003437C 27A40018 */  addiu     $a0, $sp, 0x18
/* 344D90 E0034380 AEC80000 */  sw        $t0, 0x0($s6)
/* 344D94 E0034384 8C43001C */  lw        $v1, 0x1C($v0)
/* 344D98 E0034388 3C0BDE00 */  lui       $t3, (0xDE000000 >> 16)
/* 344D9C E003438C 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 344DA0 E0034390 AD0B0008 */  sw        $t3, 0x8($t0)
/* 344DA4 E0034394 00105880 */  sll       $t3, $s0, 2
/* 344DA8 E0034398 00621821 */  addu      $v1, $v1, $v0
/* 344DAC E003439C AD030004 */  sw        $v1, 0x4($t0)
/* 344DB0 E00343A0 AFAB00D8 */  sw        $t3, 0xD8($sp)
/* 344DB4 E00343A4 3C03E003 */  lui       $v1, (0xE0034788 >> 16)
/* 344DB8 E00343A8 006B1821 */  addu      $v1, $v1, $t3
/* 344DBC E00343AC 8C634788 */  lw        $v1, (0xE0034788 & 0xFFFF)($v1)
/* 344DC0 E00343B0 25020008 */  addiu     $v0, $t0, 0x8
/* 344DC4 E00343B4 AEC20000 */  sw        $v0, 0x0($s6)
/* 344DC8 E00343B8 AD03000C */  sw        $v1, 0xC($t0)
/* 344DCC E00343BC 8E850004 */  lw        $a1, 0x4($s4)
/* 344DD0 E00343C0 8E860008 */  lw        $a2, 0x8($s4)
/* 344DD4 E00343C4 8E87000C */  lw        $a3, 0xC($s4)
/* 344DD8 E00343C8 25080010 */  addiu     $t0, $t0, 0x10
/* 344DDC E00343CC 0C080108 */  jal       shim_guTranslateF
/* 344DE0 E00343D0 AEC80000 */   sw       $t0, 0x0($s6)
/* 344DE4 E00343D4 27B50058 */  addiu     $s5, $sp, 0x58
/* 344DE8 E00343D8 4480A000 */  mtc1      $zero, $f20
/* 344DEC E00343DC 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 344DF0 E00343E0 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 344DF4 E00343E4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 344DF8 E00343E8 4481B000 */  mtc1      $at, $f22
/* 344DFC E00343EC 00031080 */  sll       $v0, $v1, 2
/* 344E00 E00343F0 00431021 */  addu      $v0, $v0, $v1
/* 344E04 E00343F4 00021080 */  sll       $v0, $v0, 2
/* 344E08 E00343F8 00431023 */  subu      $v0, $v0, $v1
/* 344E0C E00343FC 000218C0 */  sll       $v1, $v0, 3
/* 344E10 E0034400 00431021 */  addu      $v0, $v0, $v1
/* 344E14 E0034404 000210C0 */  sll       $v0, $v0, 3
/* 344E18 E0034408 4406A000 */  mfc1      $a2, $f20
/* 344E1C E003440C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 344E20 E0034410 00220821 */  addu      $at, $at, $v0
/* 344E24 E0034414 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 344E28 E0034418 4407B000 */  mfc1      $a3, $f22
/* 344E2C E003441C 46000007 */  neg.s     $f0, $f0
/* 344E30 E0034420 44050000 */  mfc1      $a1, $f0
/* 344E34 E0034424 02A0202D */  daddu     $a0, $s5, $zero
/* 344E38 E0034428 0C080104 */  jal       shim_guRotateF
/* 344E3C E003442C E7B40010 */   swc1     $f20, 0x10($sp)
/* 344E40 E0034430 02A0202D */  daddu     $a0, $s5, $zero
/* 344E44 E0034434 27A50018 */  addiu     $a1, $sp, 0x18
/* 344E48 E0034438 27BE0098 */  addiu     $fp, $sp, 0x98
/* 344E4C E003443C 0C080114 */  jal       shim_guMtxCatF
/* 344E50 E0034440 03C0302D */   daddu    $a2, $fp, $zero
/* 344E54 E0034444 8E830030 */  lw        $v1, 0x30($s4)
/* 344E58 E0034448 8E970028 */  lw        $s7, 0x28($s4)
/* 344E5C E003444C 00031040 */  sll       $v0, $v1, 1
/* 344E60 E0034450 16000054 */  bnez      $s0, .LE00345A4
/* 344E64 E0034454 00439821 */   addu     $s3, $v0, $v1
/* 344E68 E0034458 02A0202D */  daddu     $a0, $s5, $zero
/* 344E6C E003445C 3C120001 */  lui       $s2, (0x11630 >> 16)
/* 344E70 E0034460 8E850020 */  lw        $a1, 0x20($s4)
/* 344E74 E0034464 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 344E78 E0034468 00A0302D */  daddu     $a2, $a1, $zero
/* 344E7C E003446C 0C080110 */  jal       shim_guScaleF
/* 344E80 E0034470 00A0382D */   daddu    $a3, $a1, $zero
/* 344E84 E0034474 02A0202D */  daddu     $a0, $s5, $zero
/* 344E88 E0034478 03C0282D */  daddu     $a1, $fp, $zero
/* 344E8C E003447C 0C080114 */  jal       shim_guMtxCatF
/* 344E90 E0034480 27A60018 */   addiu    $a2, $sp, 0x18
/* 344E94 E0034484 27A40018 */  addiu     $a0, $sp, 0x18
/* 344E98 E0034488 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 344E9C E003448C 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 344EA0 E0034490 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 344EA4 E0034494 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 344EA8 E0034498 96050000 */  lhu       $a1, 0x0($s0)
/* 344EAC E003449C 8E220000 */  lw        $v0, 0x0($s1)
/* 344EB0 E00344A0 00052980 */  sll       $a1, $a1, 6
/* 344EB4 E00344A4 00B22821 */  addu      $a1, $a1, $s2
/* 344EB8 E00344A8 0C080118 */  jal       shim_guMtxF2L
/* 344EBC E00344AC 00452821 */   addu     $a1, $v0, $a1
/* 344EC0 E00344B0 3C022AAA */  lui       $v0, (0x2AAAAAAB >> 16)
/* 344EC4 E00344B4 3442AAAB */  ori       $v0, $v0, (0x2AAAAAAB & 0xFFFF)
/* 344EC8 E00344B8 3C09D838 */  lui       $t1, (0xD8380002 >> 16)
/* 344ECC E00344BC 35290002 */  ori       $t1, $t1, (0xD8380002 & 0xFFFF)
/* 344ED0 E00344C0 02620018 */  mult      $s3, $v0
/* 344ED4 E00344C4 8EC50000 */  lw        $a1, 0x0($s6)
/* 344ED8 E00344C8 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 344EDC E00344CC 00A0402D */  daddu     $t0, $a1, $zero
/* 344EE0 E00344D0 24A50008 */  addiu     $a1, $a1, 0x8
/* 344EE4 E00344D4 AEC50000 */  sw        $a1, 0x0($s6)
/* 344EE8 E00344D8 AD020000 */  sw        $v0, 0x0($t0)
/* 344EEC E00344DC 001317C3 */  sra       $v0, $s3, 31
/* 344EF0 E00344E0 96040000 */  lhu       $a0, 0x0($s0)
/* 344EF4 E00344E4 00005810 */  mfhi      $t3
/* 344EF8 E00344E8 000B1883 */  sra       $v1, $t3, 2
/* 344EFC E00344EC 00621823 */  subu      $v1, $v1, $v0
/* 344F00 E00344F0 00031040 */  sll       $v0, $v1, 1
/* 344F04 E00344F4 00431021 */  addu      $v0, $v0, $v1
/* 344F08 E00344F8 000210C0 */  sll       $v0, $v0, 3
/* 344F0C E00344FC 02629823 */  subu      $s3, $s3, $v0
/* 344F10 E0034500 3C03E003 */  lui       $v1, (0xE0034790 >> 16)
/* 344F14 E0034504 00731821 */  addu      $v1, $v1, $s3
/* 344F18 E0034508 90634790 */  lbu       $v1, (0xE0034790 & 0xFFFF)($v1)
/* 344F1C E003450C 3C06E003 */  lui       $a2, (0xE0034791 >> 16)
/* 344F20 E0034510 00D33021 */  addu      $a2, $a2, $s3
/* 344F24 E0034514 90C64791 */  lbu       $a2, (0xE0034791 & 0xFFFF)($a2)
/* 344F28 E0034518 3C07E003 */  lui       $a3, (0xE0034792 >> 16)
/* 344F2C E003451C 00F33821 */  addu      $a3, $a3, $s3
/* 344F30 E0034520 90E74792 */  lbu       $a3, (0xE0034792 & 0xFFFF)($a3)
/* 344F34 E0034524 24A20008 */  addiu     $v0, $a1, 0x8
/* 344F38 E0034528 AEC20000 */  sw        $v0, 0x0($s6)
/* 344F3C E003452C 24820001 */  addiu     $v0, $a0, 0x1
/* 344F40 E0034530 A6020000 */  sh        $v0, 0x0($s0)
/* 344F44 E0034534 24A20010 */  addiu     $v0, $a1, 0x10
/* 344F48 E0034538 AEC20000 */  sw        $v0, 0x0($s6)
/* 344F4C E003453C 32E200FF */  andi      $v0, $s7, 0xFF
/* 344F50 E0034540 3084FFFF */  andi      $a0, $a0, 0xFFFF
/* 344F54 E0034544 00042180 */  sll       $a0, $a0, 6
/* 344F58 E0034548 00922021 */  addu      $a0, $a0, $s2
/* 344F5C E003454C 00031E00 */  sll       $v1, $v1, 24
/* 344F60 E0034550 00063400 */  sll       $a2, $a2, 16
/* 344F64 E0034554 00661825 */  or        $v1, $v1, $a2
/* 344F68 E0034558 00073A00 */  sll       $a3, $a3, 8
/* 344F6C E003455C 00671825 */  or        $v1, $v1, $a3
/* 344F70 E0034560 00621825 */  or        $v1, $v1, $v0
/* 344F74 E0034564 3C02DA38 */  lui       $v0, (0xDA380000 >> 16)
/* 344F78 E0034568 AD030004 */  sw        $v1, 0x4($t0)
/* 344F7C E003456C ACA20000 */  sw        $v0, 0x0($a1)
/* 344F80 E0034570 8E220000 */  lw        $v0, 0x0($s1)
/* 344F84 E0034574 3C0BDE00 */  lui       $t3, (0xDE000000 >> 16)
/* 344F88 E0034578 ACAB0008 */  sw        $t3, 0x8($a1)
/* 344F8C E003457C 00441021 */  addu      $v0, $v0, $a0
/* 344F90 E0034580 ACA20004 */  sw        $v0, 0x4($a1)
/* 344F94 E0034584 3C03E003 */  lui       $v1, (0xE0034780 >> 16)
/* 344F98 E0034588 8C634780 */  lw        $v1, (0xE0034780 & 0xFFFF)($v1)
/* 344F9C E003458C 24A20018 */  addiu     $v0, $a1, 0x18
/* 344FA0 E0034590 AEC20000 */  sw        $v0, 0x0($s6)
/* 344FA4 E0034594 24020040 */  addiu     $v0, $zero, 0x40
/* 344FA8 E0034598 ACA90010 */  sw        $t1, 0x10($a1)
/* 344FAC E003459C ACA20014 */  sw        $v0, 0x14($a1)
/* 344FB0 E00345A0 ACA3000C */  sw        $v1, 0xC($a1)
.LE00345A4:
/* 344FB4 E00345A4 8E970024 */  lw        $s7, 0x24($s4)
/* 344FB8 E00345A8 2AE20100 */  slti      $v0, $s7, 0x100
/* 344FBC E00345AC 50400001 */  beql      $v0, $zero, .LE00345B4
/* 344FC0 E00345B0 241700FF */   addiu    $s7, $zero, 0xFF
.LE00345B4:
/* 344FC4 E00345B4 1AE0005A */  blez      $s7, .LE0034720
/* 344FC8 E00345B8 02A0202D */   daddu    $a0, $s5, $zero
/* 344FCC E00345BC 3C120001 */  lui       $s2, (0x11630 >> 16)
/* 344FD0 E00345C0 8E850018 */  lw        $a1, 0x18($s4)
/* 344FD4 E00345C4 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 344FD8 E00345C8 00A0302D */  daddu     $a2, $a1, $zero
/* 344FDC E00345CC 0C080110 */  jal       shim_guScaleF
/* 344FE0 E00345D0 00A0382D */   daddu    $a3, $a1, $zero
/* 344FE4 E00345D4 02A0202D */  daddu     $a0, $s5, $zero
/* 344FE8 E00345D8 03C0282D */  daddu     $a1, $fp, $zero
/* 344FEC E00345DC 0C080114 */  jal       shim_guMtxCatF
/* 344FF0 E00345E0 27A60018 */   addiu    $a2, $sp, 0x18
/* 344FF4 E00345E4 4406A000 */  mfc1      $a2, $f20
/* 344FF8 E00345E8 02A0202D */  daddu     $a0, $s5, $zero
/* 344FFC E00345EC E7B60010 */  swc1      $f22, 0x10($sp)
/* 345000 E00345F0 8E850010 */  lw        $a1, 0x10($s4)
/* 345004 E00345F4 0C080104 */  jal       shim_guRotateF
/* 345008 E00345F8 00C0382D */   daddu    $a3, $a2, $zero
/* 34500C E00345FC 02A0202D */  daddu     $a0, $s5, $zero
/* 345010 E0034600 27A50018 */  addiu     $a1, $sp, 0x18
/* 345014 E0034604 0C080114 */  jal       shim_guMtxCatF
/* 345018 E0034608 00A0302D */   daddu    $a2, $a1, $zero
/* 34501C E003460C 27A40018 */  addiu     $a0, $sp, 0x18
/* 345020 E0034610 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 345024 E0034614 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 345028 E0034618 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 34502C E003461C 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 345030 E0034620 96050000 */  lhu       $a1, 0x0($s0)
/* 345034 E0034624 8E220000 */  lw        $v0, 0x0($s1)
/* 345038 E0034628 00052980 */  sll       $a1, $a1, 6
/* 34503C E003462C 00B22821 */  addu      $a1, $a1, $s2
/* 345040 E0034630 0C080118 */  jal       shim_guMtxF2L
/* 345044 E0034634 00452821 */   addu     $a1, $v0, $a1
/* 345048 E0034638 3C0AD838 */  lui       $t2, (0xD8380002 >> 16)
/* 34504C E003463C 8EC50000 */  lw        $a1, 0x0($s6)
/* 345050 E0034640 3C08FA00 */  lui       $t0, (0xFA000000 >> 16)
/* 345054 E0034644 00A0482D */  daddu     $t1, $a1, $zero
/* 345058 E0034648 24A50008 */  addiu     $a1, $a1, 0x8
/* 34505C E003464C AEC50000 */  sw        $a1, 0x0($s6)
/* 345060 E0034650 AD280000 */  sw        $t0, 0x0($t1)
/* 345064 E0034654 3C04E003 */  lui       $a0, (0xE0034790 >> 16)
/* 345068 E0034658 00932021 */  addu      $a0, $a0, $s3
/* 34506C E003465C 90844790 */  lbu       $a0, (0xE0034790 & 0xFFFF)($a0)
/* 345070 E0034660 3C03E003 */  lui       $v1, (0xE0034791 >> 16)
/* 345074 E0034664 00731821 */  addu      $v1, $v1, $s3
/* 345078 E0034668 90634791 */  lbu       $v1, (0xE0034791 & 0xFFFF)($v1)
/* 34507C E003466C 3C07E003 */  lui       $a3, (0xE0034792 >> 16)
/* 345080 E0034670 00F33821 */  addu      $a3, $a3, $s3
/* 345084 E0034674 90E74792 */  lbu       $a3, (0xE0034792 & 0xFFFF)($a3)
/* 345088 E0034678 24A20008 */  addiu     $v0, $a1, 0x8
/* 34508C E003467C AEC20000 */  sw        $v0, 0x0($s6)
/* 345090 E0034680 96060000 */  lhu       $a2, 0x0($s0)
/* 345094 E0034684 24A20010 */  addiu     $v0, $a1, 0x10
/* 345098 E0034688 AEC20000 */  sw        $v0, 0x0($s6)
/* 34509C E003468C 24C20001 */  addiu     $v0, $a2, 0x1
/* 3450A0 E0034690 A6020000 */  sh        $v0, 0x0($s0)
/* 3450A4 E0034694 24A20018 */  addiu     $v0, $a1, 0x18
/* 3450A8 E0034698 00042600 */  sll       $a0, $a0, 24
/* 3450AC E003469C 00031C00 */  sll       $v1, $v1, 16
/* 3450B0 E00346A0 00832025 */  or        $a0, $a0, $v1
/* 3450B4 E00346A4 00073A00 */  sll       $a3, $a3, 8
/* 3450B8 E00346A8 00872025 */  or        $a0, $a0, $a3
/* 3450BC E00346AC 32E300FF */  andi      $v1, $s7, 0xFF
/* 3450C0 E00346B0 00832025 */  or        $a0, $a0, $v1
/* 3450C4 E00346B4 AEC20000 */  sw        $v0, 0x0($s6)
/* 3450C8 E00346B8 2402FF00 */  addiu     $v0, $zero, -0x100
/* 3450CC E00346BC 00621825 */  or        $v1, $v1, $v0
/* 3450D0 E00346C0 3C02DA38 */  lui       $v0, (0xDA380000 >> 16)
/* 3450D4 E00346C4 30C6FFFF */  andi      $a2, $a2, 0xFFFF
/* 3450D8 E00346C8 00063180 */  sll       $a2, $a2, 6
/* 3450DC E00346CC 00D23021 */  addu      $a2, $a2, $s2
/* 3450E0 E00346D0 AD240004 */  sw        $a0, 0x4($t1)
/* 3450E4 E00346D4 ACA80000 */  sw        $t0, 0x0($a1)
/* 3450E8 E00346D8 ACA30004 */  sw        $v1, 0x4($a1)
/* 3450EC E00346DC ACA20008 */  sw        $v0, 0x8($a1)
/* 3450F0 E00346E0 8E220000 */  lw        $v0, 0x0($s1)
/* 3450F4 E00346E4 3C0BDE00 */  lui       $t3, (0xDE000000 >> 16)
/* 3450F8 E00346E8 ACAB0010 */  sw        $t3, 0x10($a1)
/* 3450FC E00346EC 00461021 */  addu      $v0, $v0, $a2
/* 345100 E00346F0 ACA2000C */  sw        $v0, 0xC($a1)
/* 345104 E00346F4 8FAB00D8 */  lw        $t3, 0xD8($sp)
/* 345108 E00346F8 354A0002 */  ori       $t2, $t2, (0xD8380002 & 0xFFFF)
/* 34510C E00346FC 3C03E003 */  lui       $v1, (0xE0034780 >> 16)
/* 345110 E0034700 006B1821 */  addu      $v1, $v1, $t3
/* 345114 E0034704 8C634780 */  lw        $v1, (0xE0034780 & 0xFFFF)($v1)
/* 345118 E0034708 24A20020 */  addiu     $v0, $a1, 0x20
/* 34511C E003470C AEC20000 */  sw        $v0, 0x0($s6)
/* 345120 E0034710 24020040 */  addiu     $v0, $zero, 0x40
/* 345124 E0034714 ACAA0018 */  sw        $t2, 0x18($a1)
/* 345128 E0034718 ACA2001C */  sw        $v0, 0x1C($a1)
/* 34512C E003471C ACA30014 */  sw        $v1, 0x14($a1)
.LE0034720:
/* 345130 E0034720 8EC20000 */  lw        $v0, 0x0($s6)
/* 345134 E0034724 0040182D */  daddu     $v1, $v0, $zero
/* 345138 E0034728 24420008 */  addiu     $v0, $v0, 0x8
/* 34513C E003472C 3C0BE700 */  lui       $t3, (0xE7000000 >> 16)
/* 345140 E0034730 AEC20000 */  sw        $v0, 0x0($s6)
/* 345144 E0034734 AC6B0000 */  sw        $t3, 0x0($v1)
/* 345148 E0034738 AC600004 */  sw        $zero, 0x4($v1)
/* 34514C E003473C 8FBF0104 */  lw        $ra, 0x104($sp)
/* 345150 E0034740 8FBE0100 */  lw        $fp, 0x100($sp)
/* 345154 E0034744 8FB700FC */  lw        $s7, 0xFC($sp)
/* 345158 E0034748 8FB600F8 */  lw        $s6, 0xF8($sp)
/* 34515C E003474C 8FB500F4 */  lw        $s5, 0xF4($sp)
/* 345160 E0034750 8FB400F0 */  lw        $s4, 0xF0($sp)
/* 345164 E0034754 8FB300EC */  lw        $s3, 0xEC($sp)
/* 345168 E0034758 8FB200E8 */  lw        $s2, 0xE8($sp)
/* 34516C E003475C 8FB100E4 */  lw        $s1, 0xE4($sp)
/* 345170 E0034760 8FB000E0 */  lw        $s0, 0xE0($sp)
/* 345174 E0034764 D7B60110 */  ldc1      $f22, 0x110($sp)
/* 345178 E0034768 D7B40108 */  ldc1      $f20, 0x108($sp)
/* 34517C E003476C 03E00008 */  jr        $ra
/* 345180 E0034770 27BD0118 */   addiu    $sp, $sp, 0x118
/* 345184 E0034774 00000000 */  nop
/* 345188 E0034778 00000000 */  nop
/* 34518C E003477C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void lens_flare_appendGfx(void* effect) {
    LensFlareFXData* data = ((EffectInstance*)effect)->data.lensFlare;
    s32 type = data->type;
    s32 alpha;
    s32 idx;
    Matrix4f mtxTransform;
    Matrix4f mtxTemp;
    Matrix4f mtxShared;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
    gSPDisplayList(gMainGfxPos++, D_E0034788[type]);

    shim_guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(mtxTemp, mtxTransform, mtxShared);

    alpha = data->smallFlareAlpha;
    idx = data->lifetime * 3;

    // small twinkling shine which changes color
    if (type == 0) {
        shim_guScaleF(mtxTemp, data->smallFlareScale, data->smallFlareScale, data->smallFlareScale);
        shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform);
        shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);

        idx %= ARRAY_COUNT(D_E0034790);

        gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0034790[idx], D_E0034790[idx + 1], D_E0034790[idx + 2], alpha);
        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, D_E0034780[0]);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }

    alpha = data->largeFlareAlpha;
    if (alpha > 255) {
        alpha = 255;
    }

    // large growing white shine
    if (alpha > 0) {
        shim_guScaleF(mtxTemp, data->largeFlareScale, data->largeFlareScale, data->largeFlareScale);
        shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform);
        shim_guRotateF(mtxTemp, data->largeFlareRot, 0.0f, 0.0f, 1.0f);
        shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
        shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);

        gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0034790[idx], D_E0034790[idx + 1], D_E0034790[idx + 2], alpha);
        gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha);
        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, D_E0034780[type]);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    }

    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel mdl_create_model
/* AC90C 8011620C 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* AC910 80116210 AFB40040 */  sw        $s4, 0x40($sp)
/* AC914 80116214 0080A02D */  daddu     $s4, $a0, $zero
/* AC918 80116218 AFBF0044 */  sw        $ra, 0x44($sp)
/* AC91C 8011621C AFB3003C */  sw        $s3, 0x3C($sp)
/* AC920 80116220 AFB20038 */  sw        $s2, 0x38($sp)
/* AC924 80116224 AFB10034 */  sw        $s1, 0x34($sp)
/* AC928 80116228 AFB00030 */  sw        $s0, 0x30($sp)
/* AC92C 8011622C 8E920004 */  lw        $s2, 0x4($s4)
/* AC930 80116230 2405005F */  addiu     $a1, $zero, 0x5F
/* AC934 80116234 0C0456C3 */  jal       get_model_property
/* AC938 80116238 0240202D */   daddu    $a0, $s2, $zero
/* AC93C 8011623C 0040802D */  daddu     $s0, $v0, $zero
/* AC940 80116240 12000023 */  beqz      $s0, .L801162D0
/* AC944 80116244 0000982D */   daddu    $s3, $zero, $zero
/* AC948 80116248 9202000B */  lbu       $v0, 0xB($s0)
/* AC94C 8011624C 00028902 */  srl       $s1, $v0, 4
/* AC950 80116250 1220001F */  beqz      $s1, .L801162D0
/* AC954 80116254 0240202D */   daddu    $a0, $s2, $zero
/* AC958 80116258 0C0456C3 */  jal       get_model_property
/* AC95C 8011625C 24050061 */   addiu    $a1, $zero, 0x61
/* AC960 80116260 0040802D */  daddu     $s0, $v0, $zero
/* AC964 80116264 12000019 */  beqz      $s0, .L801162CC
/* AC968 80116268 27A20020 */   addiu    $v0, $sp, 0x20
/* AC96C 8011626C C6000008 */  lwc1      $f0, 0x8($s0)
/* AC970 80116270 C602002C */  lwc1      $f2, 0x2C($s0)
/* AC974 80116274 46020000 */  add.s     $f0, $f0, $f2
/* AC978 80116278 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* AC97C 8011627C 44812000 */  mtc1      $at, $f4
/* AC980 80116280 00000000 */  nop
/* AC984 80116284 46040002 */  mul.s     $f0, $f0, $f4
/* AC988 80116288 00000000 */  nop
/* AC98C 8011628C C6020044 */  lwc1      $f2, 0x44($s0)
/* AC990 80116290 44050000 */  mfc1      $a1, $f0
/* AC994 80116294 C6000020 */  lwc1      $f0, 0x20($s0)
/* AC998 80116298 46020000 */  add.s     $f0, $f0, $f2
/* AC99C 8011629C 46040002 */  mul.s     $f0, $f0, $f4
/* AC9A0 801162A0 00000000 */  nop
/* AC9A4 801162A4 44070000 */  mfc1      $a3, $f0
/* AC9A8 801162A8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* AC9AC 801162AC 44810000 */  mtc1      $at, $f0
/* AC9B0 801162B0 AFA20014 */  sw        $v0, 0x14($sp)
/* AC9B4 801162B4 E7A00010 */  swc1      $f0, 0x10($sp)
/* AC9B8 801162B8 8E060014 */  lw        $a2, 0x14($s0)
/* AC9BC 801162BC 0C01C124 */  jal       fx_flame
/* AC9C0 801162C0 2624FFFF */   addiu    $a0, $s1, -0x1
/* AC9C4 801162C4 08045995 */  j         .L80116654
/* AC9C8 801162C8 00000000 */   nop
.L801162CC:
/* AC9CC 801162CC 0000982D */  daddu     $s3, $zero, $zero
.L801162D0:
/* AC9D0 801162D0 3C108015 */  lui       $s0, %hi(gCurrentModels)
/* AC9D4 801162D4 261012CC */  addiu     $s0, $s0, %lo(gCurrentModels)
/* AC9D8 801162D8 8E030000 */  lw        $v1, 0x0($s0)
.L801162DC:
/* AC9DC 801162DC 8C620000 */  lw        $v0, 0x0($v1)
/* AC9E0 801162E0 10400005 */  beqz      $v0, .L801162F8
/* AC9E4 801162E4 00000000 */   nop
/* AC9E8 801162E8 26730001 */  addiu     $s3, $s3, 0x1
/* AC9EC 801162EC 2A620100 */  slti      $v0, $s3, 0x100
/* AC9F0 801162F0 1440FFFA */  bnez      $v0, .L801162DC
/* AC9F4 801162F4 24630004 */   addiu    $v1, $v1, 0x4
.L801162F8:
/* AC9F8 801162F8 0C00AB39 */  jal       heap_malloc
/* AC9FC 801162FC 240400B0 */   addiu    $a0, $zero, 0xB0
/* ACA00 80116300 00131880 */  sll       $v1, $s3, 2
/* ACA04 80116304 8E040000 */  lw        $a0, 0x0($s0)
/* ACA08 80116308 0040882D */  daddu     $s1, $v0, $zero
/* ACA0C 8011630C 00641821 */  addu      $v1, $v1, $a0
/* ACA10 80116310 AC710000 */  sw        $s1, 0x0($v1)
/* ACA14 80116314 96820000 */  lhu       $v0, 0x0($s4)
/* ACA18 80116318 3C038015 */  lui       $v1, %hi(D_80153226)
/* ACA1C 8011631C 94633226 */  lhu       $v1, %lo(D_80153226)($v1)
/* ACA20 80116320 34420001 */  ori       $v0, $v0, 0x1
/* ACA24 80116324 A6230002 */  sh        $v1, 0x2($s1)
/* ACA28 80116328 A6220000 */  sh        $v0, 0x0($s1)
/* ACA2C 8011632C 8E820004 */  lw        $v0, 0x4($s4)
/* ACA30 80116330 2405005F */  addiu     $a1, $zero, 0x5F
/* ACA34 80116334 AE220008 */  sw        $v0, 0x8($s1)
/* ACA38 80116338 0040902D */  daddu     $s2, $v0, $zero
/* ACA3C 8011633C 8E820008 */  lw        $v0, 0x8($s4)
/* ACA40 80116340 0240202D */  daddu     $a0, $s2, $zero
/* ACA44 80116344 A22000A7 */  sb        $zero, 0xA7($s1)
/* ACA48 80116348 0C0456C3 */  jal       get_model_property
/* ACA4C 8011634C AE22000C */   sw       $v0, 0xC($s1)
/* ACA50 80116350 0040802D */  daddu     $s0, $v0, $zero
/* ACA54 80116354 52000004 */  beql      $s0, $zero, .L80116368
/* ACA58 80116358 A22000A4 */   sb       $zero, 0xA4($s1)
/* ACA5C 8011635C 9202000B */  lbu       $v0, 0xB($s0)
/* ACA60 80116360 3042000F */  andi      $v0, $v0, 0xF
/* ACA64 80116364 A22200A4 */  sb        $v0, 0xA4($s1)
.L80116368:
/* ACA68 80116368 A22000A5 */  sb        $zero, 0xA5($s1)
/* ACA6C 8011636C 8E430000 */  lw        $v1, 0x0($s2)
/* ACA70 80116370 24020005 */  addiu     $v0, $zero, 0x5
/* ACA74 80116374 10620005 */  beq       $v1, $v0, .L8011638C
/* ACA78 80116378 0240202D */   daddu    $a0, $s2, $zero
/* ACA7C 8011637C 0C0456C3 */  jal       get_model_property
/* ACA80 80116380 2405005C */   addiu    $a1, $zero, 0x5C
/* ACA84 80116384 080458E8 */  j         .L801163A0
/* ACA88 80116388 0040802D */   daddu    $s0, $v0, $zero
.L8011638C:
/* ACA8C 8011638C 0C0456C3 */  jal       get_model_property
/* ACA90 80116390 24050060 */   addiu    $a1, $zero, 0x60
/* ACA94 80116394 0040802D */  daddu     $s0, $v0, $zero
/* ACA98 80116398 12000006 */  beqz      $s0, .L801163B4
/* ACA9C 8011639C 2610000C */   addiu    $s0, $s0, 0xC
.L801163A0:
/* ACAA0 801163A0 12000005 */  beqz      $s0, .L801163B8
/* ACAA4 801163A4 24020001 */   addiu    $v0, $zero, 0x1
/* ACAA8 801163A8 9202000B */  lbu       $v0, 0xB($s0)
/* ACAAC 801163AC 080458EF */  j         .L801163BC
/* ACAB0 801163B0 A22200A6 */   sb       $v0, 0xA6($s1)
.L801163B4:
/* ACAB4 801163B4 24020001 */  addiu     $v0, $zero, 0x1
.L801163B8:
/* ACAB8 801163B8 A22200A6 */  sb        $v0, 0xA6($s1)
.L801163BC:
/* ACABC 801163BC 3C028015 */  lui       $v0, %hi(mdl_treeIterPos)
/* ACAC0 801163C0 8C423224 */  lw        $v0, %lo(mdl_treeIterPos)($v0)
/* ACAC4 801163C4 3C03800A */  lui       $v1, %hi(mdl_currentModelTreeNodeInfo)
/* ACAC8 801163C8 8C63A5F4 */  lw        $v1, %lo(mdl_currentModelTreeNodeInfo)($v1)
/* ACACC 801163CC 00021080 */  sll       $v0, $v0, 2
/* ACAD0 801163D0 00431021 */  addu      $v0, $v0, $v1
/* ACAD4 801163D4 90420002 */  lbu       $v0, 0x2($v0)
/* ACAD8 801163D8 A22000A9 */  sb        $zero, 0xA9($s1)
/* ACADC 801163DC A22200A8 */  sb        $v0, 0xA8($s1)
/* ACAE0 801163E0 0C046F85 */  jal       is_identity_fixed_mtx
/* ACAE4 801163E4 8E84000C */   lw       $a0, 0xC($s4)
/* ACAE8 801163E8 14400021 */  bnez      $v0, .L80116470
/* ACAEC 801163EC 26240018 */   addiu    $a0, $s1, 0x18
/* ACAF0 801163F0 0C00AB39 */  jal       heap_malloc
/* ACAF4 801163F4 24040040 */   addiu    $a0, $zero, 0x40
/* ACAF8 801163F8 AE220004 */  sw        $v0, 0x4($s1)
/* ACAFC 801163FC 8E84000C */  lw        $a0, 0xC($s4)
/* ACB00 80116400 24830040 */  addiu     $v1, $a0, 0x40
.L80116404:
/* ACB04 80116404 8C880000 */  lw        $t0, 0x0($a0)
/* ACB08 80116408 8C890004 */  lw        $t1, 0x4($a0)
/* ACB0C 8011640C 8C8A0008 */  lw        $t2, 0x8($a0)
/* ACB10 80116410 8C8B000C */  lw        $t3, 0xC($a0)
/* ACB14 80116414 AC480000 */  sw        $t0, 0x0($v0)
/* ACB18 80116418 AC490004 */  sw        $t1, 0x4($v0)
/* ACB1C 8011641C AC4A0008 */  sw        $t2, 0x8($v0)
/* ACB20 80116420 AC4B000C */  sw        $t3, 0xC($v0)
/* ACB24 80116424 24840010 */  addiu     $a0, $a0, 0x10
/* ACB28 80116428 1483FFF6 */  bne       $a0, $v1, .L80116404
/* ACB2C 8011642C 24420010 */   addiu    $v0, $v0, 0x10
/* ACB30 80116430 8E220004 */  lw        $v0, 0x4($s1)
/* ACB34 80116434 26230018 */  addiu     $v1, $s1, 0x18
/* ACB38 80116438 24440040 */  addiu     $a0, $v0, 0x40
.L8011643C:
/* ACB3C 8011643C 8C480000 */  lw        $t0, 0x0($v0)
/* ACB40 80116440 8C490004 */  lw        $t1, 0x4($v0)
/* ACB44 80116444 8C4A0008 */  lw        $t2, 0x8($v0)
/* ACB48 80116448 8C4B000C */  lw        $t3, 0xC($v0)
/* ACB4C 8011644C AC680000 */  sw        $t0, 0x0($v1)
/* ACB50 80116450 AC690004 */  sw        $t1, 0x4($v1)
/* ACB54 80116454 AC6A0008 */  sw        $t2, 0x8($v1)
/* ACB58 80116458 AC6B000C */  sw        $t3, 0xC($v1)
/* ACB5C 8011645C 24420010 */  addiu     $v0, $v0, 0x10
/* ACB60 80116460 1444FFF6 */  bne       $v0, $a0, .L8011643C
/* ACB64 80116464 24630010 */   addiu    $v1, $v1, 0x10
/* ACB68 80116468 08045921 */  j         .L80116484
/* ACB6C 8011646C 00000000 */   nop
.L80116470:
/* ACB70 80116470 0C019D10 */  jal       guMtxIdent
/* ACB74 80116474 AE200004 */   sw       $zero, 0x4($s1)
/* ACB78 80116478 96220000 */  lhu       $v0, 0x0($s1)
/* ACB7C 8011647C 34422000 */  ori       $v0, $v0, 0x2000
/* ACB80 80116480 A6220000 */  sh        $v0, 0x0($s1)
.L80116484:
/* ACB84 80116484 0C019D28 */  jal       guMtxIdentF
/* ACB88 80116488 26240058 */   addiu    $a0, $s1, 0x58
/* ACB8C 8011648C AE200010 */  sw        $zero, 0x10($s1)
/* ACB90 80116490 0240202D */  daddu     $a0, $s2, $zero
/* ACB94 80116494 0C0456C3 */  jal       get_model_property
/* ACB98 80116498 24050061 */   addiu    $a1, $zero, 0x61
/* ACB9C 8011649C 0040802D */  daddu     $s0, $v0, $zero
/* ACBA0 801164A0 12000017 */  beqz      $s0, .L80116500
/* ACBA4 801164A4 00000000 */   nop
/* ACBA8 801164A8 C6060008 */  lwc1      $f6, 0x8($s0)
/* ACBAC 801164AC C600002C */  lwc1      $f0, 0x2C($s0)
/* ACBB0 801164B0 46003180 */  add.s     $f6, $f6, $f0
/* ACBB4 801164B4 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* ACBB8 801164B8 44814000 */  mtc1      $at, $f8
/* ACBBC 801164BC 00000000 */  nop
/* ACBC0 801164C0 46083182 */  mul.s     $f6, $f6, $f8
/* ACBC4 801164C4 00000000 */  nop
/* ACBC8 801164C8 C6040014 */  lwc1      $f4, 0x14($s0)
/* ACBCC 801164CC C6000038 */  lwc1      $f0, 0x38($s0)
/* ACBD0 801164D0 46002100 */  add.s     $f4, $f4, $f0
/* ACBD4 801164D4 46082102 */  mul.s     $f4, $f4, $f8
/* ACBD8 801164D8 00000000 */  nop
/* ACBDC 801164DC C6020044 */  lwc1      $f2, 0x44($s0)
/* ACBE0 801164E0 C6000020 */  lwc1      $f0, 0x20($s0)
/* ACBE4 801164E4 46020000 */  add.s     $f0, $f0, $f2
/* ACBE8 801164E8 46080002 */  mul.s     $f0, $f0, $f8
/* ACBEC 801164EC 00000000 */  nop
/* ACBF0 801164F0 E7A60024 */  swc1      $f6, 0x24($sp)
/* ACBF4 801164F4 E7A40028 */  swc1      $f4, 0x28($sp)
/* ACBF8 801164F8 08045945 */  j         .L80116514
/* ACBFC 801164FC E7A0002C */   swc1     $f0, 0x2C($sp)
.L80116500:
/* ACC00 80116500 44800000 */  mtc1      $zero, $f0
/* ACC04 80116504 00000000 */  nop
/* ACC08 80116508 E7A0002C */  swc1      $f0, 0x2C($sp)
/* ACC0C 8011650C E7A00028 */  swc1      $f0, 0x28($sp)
/* ACC10 80116510 E7A00024 */  swc1      $f0, 0x24($sp)
.L80116514:
/* ACC14 80116514 8E220004 */  lw        $v0, 0x4($s1)
/* ACC18 80116518 1040000F */  beqz      $v0, .L80116558
/* ACC1C 8011651C 27A20024 */   addiu    $v0, $sp, 0x24
/* ACC20 80116520 C7A00024 */  lwc1      $f0, 0x24($sp)
/* ACC24 80116524 C7A20028 */  lwc1      $f2, 0x28($sp)
/* ACC28 80116528 C7A4002C */  lwc1      $f4, 0x2C($sp)
/* ACC2C 8011652C AFA20010 */  sw        $v0, 0x10($sp)
/* ACC30 80116530 27A20028 */  addiu     $v0, $sp, 0x28
/* ACC34 80116534 AFA20014 */  sw        $v0, 0x14($sp)
/* ACC38 80116538 27A2002C */  addiu     $v0, $sp, 0x2C
/* ACC3C 8011653C AFA20018 */  sw        $v0, 0x18($sp)
/* ACC40 80116540 8E240004 */  lw        $a0, 0x4($s1)
/* ACC44 80116544 44050000 */  mfc1      $a1, $f0
/* ACC48 80116548 44061000 */  mfc1      $a2, $f2
/* ACC4C 8011654C 44072000 */  mfc1      $a3, $f4
/* ACC50 80116550 0C019E78 */  jal       guMtxXFML
/* ACC54 80116554 00000000 */   nop
.L80116558:
/* ACC58 80116558 C7A00024 */  lwc1      $f0, 0x24($sp)
/* ACC5C 8011655C C7A20028 */  lwc1      $f2, 0x28($sp)
/* ACC60 80116560 C7A4002C */  lwc1      $f4, 0x2C($sp)
/* ACC64 80116564 E6200098 */  swc1      $f0, 0x98($s1)
/* ACC68 80116568 E622009C */  swc1      $f2, 0x9C($s1)
/* ACC6C 8011656C E62400A0 */  swc1      $f4, 0xA0($s1)
/* ACC70 80116570 C602002C */  lwc1      $f2, 0x2C($s0)
/* ACC74 80116574 C6000008 */  lwc1      $f0, 0x8($s0)
/* ACC78 80116578 46001301 */  sub.s     $f12, $f2, $f0
/* ACC7C 8011657C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* ACC80 80116580 44812800 */  mtc1      $at, $f5
/* ACC84 80116584 44802000 */  mtc1      $zero, $f4
/* ACC88 80116588 460061A1 */  cvt.d.s   $f6, $f12
/* ACC8C 8011658C 46243182 */  mul.d     $f6, $f6, $f4
/* ACC90 80116590 00000000 */  nop
/* ACC94 80116594 C6020038 */  lwc1      $f2, 0x38($s0)
/* ACC98 80116598 C6000014 */  lwc1      $f0, 0x14($s0)
/* ACC9C 8011659C 46001281 */  sub.s     $f10, $f2, $f0
/* ACCA0 801165A0 460050A1 */  cvt.d.s   $f2, $f10
/* ACCA4 801165A4 46241082 */  mul.d     $f2, $f2, $f4
/* ACCA8 801165A8 00000000 */  nop
/* ACCAC 801165AC C6080044 */  lwc1      $f8, 0x44($s0)
/* ACCB0 801165B0 C6000020 */  lwc1      $f0, 0x20($s0)
/* ACCB4 801165B4 46004201 */  sub.s     $f8, $f8, $f0
/* ACCB8 801165B8 46004021 */  cvt.d.s   $f0, $f8
/* ACCBC 801165BC 46240002 */  mul.d     $f0, $f0, $f4
/* ACCC0 801165C0 00000000 */  nop
/* ACCC4 801165C4 4620338D */  trunc.w.d $f14, $f6
/* ACCC8 801165C8 E60E0004 */  swc1      $f14, 0x4($s0)
/* ACCCC 801165CC 4620138D */  trunc.w.d $f14, $f2
/* ACCD0 801165D0 E60E0010 */  swc1      $f14, 0x10($s0)
/* ACCD4 801165D4 4620038D */  trunc.w.d $f14, $f0
/* ACCD8 801165D8 E60E001C */  swc1      $f14, 0x1C($s0)
/* ACCDC 801165DC 8E220004 */  lw        $v0, 0x4($s1)
/* ACCE0 801165E0 E7AC0024 */  swc1      $f12, 0x24($sp)
/* ACCE4 801165E4 E7AA0028 */  swc1      $f10, 0x28($sp)
/* ACCE8 801165E8 14400013 */  bnez      $v0, .L80116638
/* ACCEC 801165EC E7A8002C */   swc1     $f8, 0x2C($sp)
/* ACCF0 801165F0 3C0142C8 */  lui       $at, (0x42C80000 >> 16)
/* ACCF4 801165F4 44810000 */  mtc1      $at, $f0
/* ACCF8 801165F8 00000000 */  nop
/* ACCFC 801165FC 4600603C */  c.lt.s    $f12, $f0
/* ACD00 80116600 00000000 */  nop
/* ACD04 80116604 4500000C */  bc1f      .L80116638
/* ACD08 80116608 00000000 */   nop
/* ACD0C 8011660C 4600503C */  c.lt.s    $f10, $f0
/* ACD10 80116610 00000000 */  nop
/* ACD14 80116614 45000008 */  bc1f      .L80116638
/* ACD18 80116618 00000000 */   nop
/* ACD1C 8011661C 4600403C */  c.lt.s    $f8, $f0
/* ACD20 80116620 00000000 */  nop
/* ACD24 80116624 45000004 */  bc1f      .L80116638
/* ACD28 80116628 00000000 */   nop
/* ACD2C 8011662C 96220000 */  lhu       $v0, 0x0($s1)
/* ACD30 80116630 34420200 */  ori       $v0, $v0, 0x200
/* ACD34 80116634 A6220000 */  sh        $v0, 0x0($s1)
.L80116638:
/* ACD38 80116638 3C028015 */  lui       $v0, %hi(mdl_treeIterPos)
/* ACD3C 8011663C 8C423224 */  lw        $v0, %lo(mdl_treeIterPos)($v0)
/* ACD40 80116640 3C03800A */  lui       $v1, %hi(mdl_currentModelTreeNodeInfo)
/* ACD44 80116644 8C63A5F4 */  lw        $v1, %lo(mdl_currentModelTreeNodeInfo)($v1)
/* ACD48 80116648 00021080 */  sll       $v0, $v0, 2
/* ACD4C 8011664C 00431021 */  addu      $v0, $v0, $v1
/* ACD50 80116650 A0530000 */  sb        $s3, 0x0($v0)
.L80116654:
/* ACD54 80116654 8FBF0044 */  lw        $ra, 0x44($sp)
/* ACD58 80116658 8FB40040 */  lw        $s4, 0x40($sp)
/* ACD5C 8011665C 8FB3003C */  lw        $s3, 0x3C($sp)
/* ACD60 80116660 8FB20038 */  lw        $s2, 0x38($sp)
/* ACD64 80116664 8FB10034 */  lw        $s1, 0x34($sp)
/* ACD68 80116668 8FB00030 */  lw        $s0, 0x30($sp)
/* ACD6C 8011666C 03E00008 */  jr        $ra
/* ACD70 80116670 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void mdl_create_model(ModelBlueprint* bp, s32 arg1) {
    EffectInstance* effect;
    ModelNode* node = bp->mdlNode;
    ModelNodeProperty* prop;
    ModelBoundingBox* bb;
    s32 modelIdx;
    Model* model;
    f32 x, y, z;

    prop = get_model_property(node, MODEL_PROP_KEY_SPECIAL);
    modelIdx = 0;
    if (prop != NULL) {
        s32 temp_s1 = (u8) prop->data.s / 16;

        if (temp_s1 != 0) {
            prop = get_model_property(node, MODEL_PROP_KEY_BOUNDING_BOX);
            if (prop != NULL) {
                ModelBoundingBox* bb = (ModelBoundingBox*) prop;

                fx_flame(
                    temp_s1 - 1, (bb->minX + bb->maxX) * 0.5f, bb->minY, (bb->minZ + bb->maxZ) * 0.5f, 1.0f, &effect
                );
                return;
            }
        }
    }

    for (modelIdx = 0; modelIdx < ARRAY_COUNT(*gCurrentModels); modelIdx++) {
        if ((*gCurrentModels)[modelIdx] == NULL) {
            break;
        }
    }

    (*gCurrentModels)[modelIdx] = model = heap_malloc(sizeof(*model));
    model->flags = bp->flags | MODEL_FLAG_FLAG_1;
    model->modelID = D_80153226;
    model->modelNode = bp->mdlNode;
    model->groupData = bp->groupData;
    model->matrixMode = 0;
    node = model->modelNode;
    prop = get_model_property(node, MODEL_PROP_KEY_SPECIAL);
    if (prop != NULL) {
        model->texPannerID = prop->data.s & 0xF;
    } else {
        model->texPannerID = TEX_PANNER_0;
    }
    model->customGfxIndex = CUSTOM_GFX_0;

    if (node->type != SHAPE_TYPE_GROUP) {
        prop = get_model_property(node, MODEL_PROP_KEY_RENDER_MODE);
    } else {
        prop = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);

        if (prop != NULL) {
            prop = &prop[1];
        }
    }

    if (prop != NULL) {
        model->renderMode = prop->data.s;
    } else {
        model->renderMode = RENDER_MODE_SURFACE_OPA;
    }

    model->textureID = (*mdl_currentModelTreeNodeInfo)[mdl_treeIterPos].textureID;
    model->textureVariation = 0;

    if (!is_identity_fixed_mtx(bp->mtx)) {
        model->currentMatrix = heap_malloc(sizeof(*model->currentMatrix));
        *model->currentMatrix = *bp->mtx;
        model->specialMatrix = *model->currentMatrix;
    } else {
        model->currentMatrix = NULL;
        guMtxIdent(&model->specialMatrix);
        model->flags |= MODEL_FLAG_FLAG_2000;
    }

    guMtxIdentF(model->transformMatrix);
    model->currentSpecialMatrix = NULL;
    prop = get_model_property(node, MODEL_PROP_KEY_BOUNDING_BOX);
    if (prop != NULL) {
        ModelBoundingBox* bb = (ModelBoundingBox*) prop;

        x = (bb->minX + bb->maxX) * 0.5f;
        y = (bb->minY + bb->maxY) * 0.5f;
        z = (bb->minZ + bb->maxZ) * 0.5f;
    } else {
        x = y = z = 0.0f;
    }

    if (model->currentMatrix != NULL) {
        guMtxXFML(model->currentMatrix, x, y, z, &x, &y, &z);
    }

    model->center.x = x;
    model->center.y = y;
    model->center.z = z;

    bb = (ModelBoundingBox*) prop;
    x = bb->maxX - bb->minX;
    y = bb->maxY - bb->minY;
    z = bb->maxZ - bb->minZ;
    bb->halfSizeX = x * 0.5;
    bb->halfSizeY = y * 0.5;
    bb->halfSizeZ = z * 0.5;

    if (model->currentMatrix == NULL && x < 100.0f && y < 100.0f && z < 100.0f) {
        model->flags |= MODEL_FLAG_FLAG_200;
    }
    (*mdl_currentModelTreeNodeInfo)[mdl_treeIterPos].modelIndex = modelIdx;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel step_model_animator
/* B52F0 8011EBF0 27BDFFC8 */  addiu     $sp, $sp, -0x38
/* B52F4 8011EBF4 AFB10014 */  sw        $s1, 0x14($sp)
/* B52F8 8011EBF8 0080882D */  daddu     $s1, $a0, $zero
/* B52FC 8011EBFC AFBF0018 */  sw        $ra, 0x18($sp)
/* B5300 8011EC00 AFB00010 */  sw        $s0, 0x10($sp)
/* B5304 8011EC04 F7B80030 */  sdc1      $f24, 0x30($sp)
/* B5308 8011EC08 F7B60028 */  sdc1      $f22, 0x28($sp)
/* B530C 8011EC0C F7B40020 */  sdc1      $f20, 0x20($sp)
/* B5310 8011EC10 8E300008 */  lw        $s0, 0x8($s1)
/* B5314 8011EC14 86030000 */  lh        $v1, 0x0($s0)
/* B5318 8011EC18 2C620014 */  sltiu     $v0, $v1, 0x14
/* B531C 8011EC1C 10400105 */  beqz      $v0, .L8011F034
/* B5320 8011EC20 26100002 */   addiu    $s0, $s0, 0x2
/* B5324 8011EC24 00031080 */  sll       $v0, $v1, 2
/* B5328 8011EC28 3C018015 */  lui       $at, %hi(jtbl_8014FE60)
/* B532C 8011EC2C 00220821 */  addu      $at, $at, $v0
/* B5330 8011EC30 8C22FE60 */  lw        $v0, %lo(jtbl_8014FE60)($at)
/* B5334 8011EC34 00400008 */  jr        $v0
/* B5338 8011EC38 00000000 */   nop
glabel .L8011EC3C
/* B533C 8011EC3C 08047C0E */  j         .L8011F038
/* B5340 8011EC40 2402FFFF */   addiu    $v0, $zero, -0x1
glabel .L8011EC44
/* B5344 8011EC44 92030001 */  lbu       $v1, 0x1($s0)
/* B5348 8011EC48 26100002 */  addiu     $s0, $s0, 0x2
/* B534C 8011EC4C 24020001 */  addiu     $v0, $zero, 0x1
/* B5350 8011EC50 AE300008 */  sw        $s0, 0x8($s1)
/* B5354 8011EC54 08047C0E */  j         .L8011F038
/* B5358 8011EC58 A2230004 */   sb       $v1, 0x4($s1)
glabel .L8011EC5C
/* B535C 8011EC5C 86020000 */  lh        $v0, 0x0($s0)
/* B5360 8011EC60 26100002 */  addiu     $s0, $s0, 0x2
/* B5364 8011EC64 AE300008 */  sw        $s0, 0x8($s1)
/* B5368 8011EC68 44820000 */  mtc1      $v0, $f0
/* B536C 8011EC6C 00000000 */  nop
/* B5370 8011EC70 46800020 */  cvt.s.w   $f0, $f0
/* B5374 8011EC74 08047C0D */  j         .L8011F034
/* B5378 8011EC78 E6200090 */   swc1     $f0, 0x90($s1)
glabel .L8011EC7C
/* B537C 8011EC7C 8E23000C */  lw        $v1, 0xC($s1)
/* B5380 8011EC80 24020001 */  addiu     $v0, $zero, 0x1
/* B5384 8011EC84 08047C0E */  j         .L8011F038
/* B5388 8011EC88 AE230008 */   sw       $v1, 0x8($s1)
glabel .L8011EC8C
/* B538C 8011EC8C 24020001 */  addiu     $v0, $zero, 0x1
/* B5390 8011EC90 AE30000C */  sw        $s0, 0xC($s1)
/* B5394 8011EC94 08047C0E */  j         .L8011F038
/* B5398 8011EC98 AE300008 */   sw       $s0, 0x8($s1)
glabel .L8011EC9C
/* B539C 8011EC9C 86040000 */  lh        $a0, 0x0($s0)
/* B53A0 8011ECA0 26100002 */  addiu     $s0, $s0, 0x2
/* B53A4 8011ECA4 8E230000 */  lw        $v1, 0x0($s1)
/* B53A8 8011ECA8 24020001 */  addiu     $v0, $zero, 0x1
/* B53AC 8011ECAC AE300008 */  sw        $s0, 0x8($s1)
/* B53B0 8011ECB0 08047B4F */  j         .L8011ED3C
/* B53B4 8011ECB4 3084FFFF */   andi     $a0, $a0, 0xFFFF
glabel .L8011ECB8
/* B53B8 8011ECB8 86020000 */  lh        $v0, 0x0($s0)
/* B53BC 8011ECBC 8E240010 */  lw        $a0, 0x10($s1)
/* B53C0 8011ECC0 00511021 */  addu      $v0, $v0, $s1
/* B53C4 8011ECC4 90450014 */  lbu       $a1, 0x14($v0)
/* B53C8 8011ECC8 0C047837 */  jal       get_animator_child_with_id
/* B53CC 8011ECCC 26100002 */   addiu    $s0, $s0, 0x2
/* B53D0 8011ECD0 0040282D */  daddu     $a1, $v0, $zero
/* B53D4 8011ECD4 86040000 */  lh        $a0, 0x0($s0)
/* B53D8 8011ECD8 26100002 */  addiu     $s0, $s0, 0x2
/* B53DC 8011ECDC 94A300F4 */  lhu       $v1, 0xF4($a1)
/* B53E0 8011ECE0 24020001 */  addiu     $v0, $zero, 0x1
/* B53E4 8011ECE4 08047B48 */  j         .L8011ED20
/* B53E8 8011ECE8 00641825 */   or       $v1, $v1, $a0
glabel .L8011ECEC
/* B53EC 8011ECEC 86020000 */  lh        $v0, 0x0($s0)
/* B53F0 8011ECF0 8E240010 */  lw        $a0, 0x10($s1)
/* B53F4 8011ECF4 00511021 */  addu      $v0, $v0, $s1
/* B53F8 8011ECF8 90450014 */  lbu       $a1, 0x14($v0)
/* B53FC 8011ECFC 0C047837 */  jal       get_animator_child_with_id
/* B5400 8011ED00 26100002 */   addiu    $s0, $s0, 0x2
/* B5404 8011ED04 0040282D */  daddu     $a1, $v0, $zero
/* B5408 8011ED08 86040000 */  lh        $a0, 0x0($s0)
/* B540C 8011ED0C 26100002 */  addiu     $s0, $s0, 0x2
/* B5410 8011ED10 24020001 */  addiu     $v0, $zero, 0x1
/* B5414 8011ED14 94A300F4 */  lhu       $v1, 0xF4($a1)
/* B5418 8011ED18 00042027 */  nor       $a0, $zero, $a0
/* B541C 8011ED1C 00641824 */  and       $v1, $v1, $a0
.L8011ED20:
/* B5420 8011ED20 A4A300F4 */  sh        $v1, 0xF4($a1)
/* B5424 8011ED24 08047C0E */  j         .L8011F038
/* B5428 8011ED28 AE300008 */   sw       $s0, 0x8($s1)
glabel .L8011ED2C
/* B542C 8011ED2C 24020001 */  addiu     $v0, $zero, 0x1
/* B5430 8011ED30 8E230000 */  lw        $v1, 0x0($s1)
/* B5434 8011ED34 3C040002 */  lui       $a0, (0x20000 >> 16)
/* B5438 8011ED38 AE300008 */  sw        $s0, 0x8($s1)
.L8011ED3C:
/* B543C 8011ED3C 00641825 */  or        $v1, $v1, $a0
/* B5440 8011ED40 08047C0E */  j         .L8011F038
/* B5444 8011ED44 AE230000 */   sw       $v1, 0x0($s1)
glabel .L8011ED48
/* B5448 8011ED48 86030000 */  lh        $v1, 0x0($s0)
/* B544C 8011ED4C 26100002 */  addiu     $s0, $s0, 0x2
/* B5450 8011ED50 86020000 */  lh        $v0, 0x0($s0)
/* B5454 8011ED54 3C018015 */  lui       $at, %hi(D_8014FEB0)
/* B5458 8011ED58 D424FEB0 */  ldc1      $f4, %lo(D_8014FEB0)($at)
/* B545C 8011ED5C 44823000 */  mtc1      $v0, $f6
/* B5460 8011ED60 00000000 */  nop
/* B5464 8011ED64 468031A0 */  cvt.s.w   $f6, $f6
/* B5468 8011ED68 460031A1 */  cvt.d.s   $f6, $f6
/* B546C 8011ED6C 46243182 */  mul.d     $f6, $f6, $f4
/* B5470 8011ED70 00000000 */  nop
/* B5474 8011ED74 26100002 */  addiu     $s0, $s0, 0x2
/* B5478 8011ED78 86020000 */  lh        $v0, 0x0($s0)
/* B547C 8011ED7C 44821000 */  mtc1      $v0, $f2
/* B5480 8011ED80 00000000 */  nop
/* B5484 8011ED84 468010A0 */  cvt.s.w   $f2, $f2
/* B5488 8011ED88 460010A1 */  cvt.d.s   $f2, $f2
/* B548C 8011ED8C 46241082 */  mul.d     $f2, $f2, $f4
/* B5490 8011ED90 00000000 */  nop
/* B5494 8011ED94 8E240010 */  lw        $a0, 0x10($s1)
/* B5498 8011ED98 26100002 */  addiu     $s0, $s0, 0x2
/* B549C 8011ED9C 00711821 */  addu      $v1, $v1, $s1
/* B54A0 8011EDA0 86020000 */  lh        $v0, 0x0($s0)
/* B54A4 8011EDA4 90650014 */  lbu       $a1, 0x14($v1)
/* B54A8 8011EDA8 44820000 */  mtc1      $v0, $f0
/* B54AC 8011EDAC 00000000 */  nop
/* B54B0 8011EDB0 46800020 */  cvt.s.w   $f0, $f0
/* B54B4 8011EDB4 46000021 */  cvt.d.s   $f0, $f0
/* B54B8 8011EDB8 46240002 */  mul.d     $f0, $f0, $f4
/* B54BC 8011EDBC 00000000 */  nop
/* B54C0 8011EDC0 3C018015 */  lui       $at, %hi(D_8014FEB8)
/* B54C4 8011EDC4 D424FEB8 */  ldc1      $f4, %lo(D_8014FEB8)($at)
/* B54C8 8011EDC8 26100002 */  addiu     $s0, $s0, 0x2
/* B54CC 8011EDCC AE300008 */  sw        $s0, 0x8($s1)
/* B54D0 8011EDD0 46243183 */  div.d     $f6, $f6, $f4
/* B54D4 8011EDD4 46203620 */  cvt.s.d   $f24, $f6
/* B54D8 8011EDD8 46241083 */  div.d     $f2, $f2, $f4
/* B54DC 8011EDDC 462015A0 */  cvt.s.d   $f22, $f2
/* B54E0 8011EDE0 46240003 */  div.d     $f0, $f0, $f4
/* B54E4 8011EDE4 0C047837 */  jal       get_animator_child_with_id
/* B54E8 8011EDE8 46200520 */   cvt.s.d  $f20, $f0
/* B54EC 8011EDEC 0040282D */  daddu     $a1, $v0, $zero
/* B54F0 8011EDF0 14A00003 */  bnez      $a1, .L8011EE00
/* B54F4 8011EDF4 24020001 */   addiu    $v0, $zero, 0x1
.L8011EDF8:
/* B54F8 8011EDF8 08047B7E */  j         .L8011EDF8
/* B54FC 8011EDFC 00000000 */   nop
.L8011EE00:
/* B5500 8011EE00 E4B8009C */  swc1      $f24, 0x9C($a1)
/* B5504 8011EE04 E4B600A0 */  swc1      $f22, 0xA0($a1)
/* B5508 8011EE08 08047C0E */  j         .L8011F038
/* B550C 8011EE0C E4B400A4 */   swc1     $f20, 0xA4($a1)
glabel .L8011EE10
/* B5510 8011EE10 86030000 */  lh        $v1, 0x0($s0)
/* B5514 8011EE14 26100002 */  addiu     $s0, $s0, 0x2
/* B5518 8011EE18 86020000 */  lh        $v0, 0x0($s0)
/* B551C 8011EE1C 3C018015 */  lui       $at, %hi(D_8014FEC0)
/* B5520 8011EE20 D424FEC0 */  ldc1      $f4, %lo(D_8014FEC0)($at)
/* B5524 8011EE24 44823000 */  mtc1      $v0, $f6
/* B5528 8011EE28 00000000 */  nop
/* B552C 8011EE2C 468031A0 */  cvt.s.w   $f6, $f6
/* B5530 8011EE30 460031A1 */  cvt.d.s   $f6, $f6
/* B5534 8011EE34 46243182 */  mul.d     $f6, $f6, $f4
/* B5538 8011EE38 00000000 */  nop
/* B553C 8011EE3C 26100002 */  addiu     $s0, $s0, 0x2
/* B5540 8011EE40 86020000 */  lh        $v0, 0x0($s0)
/* B5544 8011EE44 44821000 */  mtc1      $v0, $f2
/* B5548 8011EE48 00000000 */  nop
/* B554C 8011EE4C 468010A0 */  cvt.s.w   $f2, $f2
/* B5550 8011EE50 460010A1 */  cvt.d.s   $f2, $f2
/* B5554 8011EE54 46241082 */  mul.d     $f2, $f2, $f4
/* B5558 8011EE58 00000000 */  nop
/* B555C 8011EE5C 8E240010 */  lw        $a0, 0x10($s1)
/* B5560 8011EE60 26100002 */  addiu     $s0, $s0, 0x2
/* B5564 8011EE64 00711821 */  addu      $v1, $v1, $s1
/* B5568 8011EE68 86020000 */  lh        $v0, 0x0($s0)
/* B556C 8011EE6C 90650014 */  lbu       $a1, 0x14($v1)
/* B5570 8011EE70 44820000 */  mtc1      $v0, $f0
/* B5574 8011EE74 00000000 */  nop
/* B5578 8011EE78 46800020 */  cvt.s.w   $f0, $f0
/* B557C 8011EE7C 46000021 */  cvt.d.s   $f0, $f0
/* B5580 8011EE80 46240002 */  mul.d     $f0, $f0, $f4
/* B5584 8011EE84 00000000 */  nop
/* B5588 8011EE88 3C018015 */  lui       $at, %hi(D_8014FEC8)
/* B558C 8011EE8C D424FEC8 */  ldc1      $f4, %lo(D_8014FEC8)($at)
/* B5590 8011EE90 26100002 */  addiu     $s0, $s0, 0x2
/* B5594 8011EE94 AE300008 */  sw        $s0, 0x8($s1)
/* B5598 8011EE98 46243183 */  div.d     $f6, $f6, $f4
/* B559C 8011EE9C 46203620 */  cvt.s.d   $f24, $f6
/* B55A0 8011EEA0 46241083 */  div.d     $f2, $f2, $f4
/* B55A4 8011EEA4 462015A0 */  cvt.s.d   $f22, $f2
/* B55A8 8011EEA8 46240003 */  div.d     $f0, $f0, $f4
/* B55AC 8011EEAC 0C047837 */  jal       get_animator_child_with_id
/* B55B0 8011EEB0 46200520 */   cvt.s.d  $f20, $f0
/* B55B4 8011EEB4 0040282D */  daddu     $a1, $v0, $zero
/* B55B8 8011EEB8 14A00003 */  bnez      $a1, .L8011EEC8
/* B55BC 8011EEBC 24020001 */   addiu    $v0, $zero, 0x1
.L8011EEC0:
/* B55C0 8011EEC0 08047BB0 */  j         .L8011EEC0
/* B55C4 8011EEC4 00000000 */   nop
.L8011EEC8:
/* B55C8 8011EEC8 C4A4009C */  lwc1      $f4, 0x9C($a1)
/* B55CC 8011EECC 46182100 */  add.s     $f4, $f4, $f24
/* B55D0 8011EED0 C4A200A0 */  lwc1      $f2, 0xA0($a1)
/* B55D4 8011EED4 46161080 */  add.s     $f2, $f2, $f22
/* B55D8 8011EED8 C4A000A4 */  lwc1      $f0, 0xA4($a1)
/* B55DC 8011EEDC 46140000 */  add.s     $f0, $f0, $f20
/* B55E0 8011EEE0 E4A4009C */  swc1      $f4, 0x9C($a1)
/* B55E4 8011EEE4 E4A200A0 */  swc1      $f2, 0xA0($a1)
/* B55E8 8011EEE8 08047C0E */  j         .L8011F038
/* B55EC 8011EEEC E4A000A4 */   swc1     $f0, 0xA4($a1)
glabel .L8011EEF0
/* B55F0 8011EEF0 86020000 */  lh        $v0, 0x0($s0)
/* B55F4 8011EEF4 26100002 */  addiu     $s0, $s0, 0x2
/* B55F8 8011EEF8 86050000 */  lh        $a1, 0x0($s0)
/* B55FC 8011EEFC 26100002 */  addiu     $s0, $s0, 0x2
/* B5600 8011EF00 86030000 */  lh        $v1, 0x0($s0)
/* B5604 8011EF04 26100002 */  addiu     $s0, $s0, 0x2
/* B5608 8011EF08 86060000 */  lh        $a2, 0x0($s0)
/* B560C 8011EF0C 26100002 */  addiu     $s0, $s0, 0x2
/* B5610 8011EF10 8E240010 */  lw        $a0, 0x10($s1)
/* B5614 8011EF14 4485C000 */  mtc1      $a1, $f24
/* B5618 8011EF18 00000000 */  nop
/* B561C 8011EF1C 4680C620 */  cvt.s.w   $f24, $f24
/* B5620 8011EF20 4483B000 */  mtc1      $v1, $f22
/* B5624 8011EF24 00000000 */  nop
/* B5628 8011EF28 4680B5A0 */  cvt.s.w   $f22, $f22
/* B562C 8011EF2C 00511021 */  addu      $v0, $v0, $s1
/* B5630 8011EF30 90450014 */  lbu       $a1, 0x14($v0)
/* B5634 8011EF34 4486A000 */  mtc1      $a2, $f20
/* B5638 8011EF38 00000000 */  nop
/* B563C 8011EF3C 4680A520 */  cvt.s.w   $f20, $f20
/* B5640 8011EF40 0C047837 */  jal       get_animator_child_with_id
/* B5644 8011EF44 AE300008 */   sw       $s0, 0x8($s1)
/* B5648 8011EF48 0040282D */  daddu     $a1, $v0, $zero
/* B564C 8011EF4C 14A00003 */  bnez      $a1, .L8011EF5C
/* B5650 8011EF50 24020001 */   addiu    $v0, $zero, 0x1
.L8011EF54:
/* B5654 8011EF54 08047BD5 */  j         .L8011EF54
/* B5658 8011EF58 00000000 */   nop
.L8011EF5C:
/* B565C 8011EF5C E4B80090 */  swc1      $f24, 0x90($a1)
/* B5660 8011EF60 E4B60094 */  swc1      $f22, 0x94($a1)
/* B5664 8011EF64 08047C0E */  j         .L8011F038
/* B5668 8011EF68 E4B40098 */   swc1     $f20, 0x98($a1)
glabel .L8011EF6C
/* B566C 8011EF6C 86030000 */  lh        $v1, 0x0($s0)
/* B5670 8011EF70 26100002 */  addiu     $s0, $s0, 0x2
/* B5674 8011EF74 86020000 */  lh        $v0, 0x0($s0)
/* B5678 8011EF78 3C018015 */  lui       $at, %hi(D_8014FED0)
/* B567C 8011EF7C D424FED0 */  ldc1      $f4, %lo(D_8014FED0)($at)
/* B5680 8011EF80 44823000 */  mtc1      $v0, $f6
/* B5684 8011EF84 00000000 */  nop
/* B5688 8011EF88 468031A0 */  cvt.s.w   $f6, $f6
/* B568C 8011EF8C 460031A1 */  cvt.d.s   $f6, $f6
/* B5690 8011EF90 46243182 */  mul.d     $f6, $f6, $f4
/* B5694 8011EF94 00000000 */  nop
/* B5698 8011EF98 26100002 */  addiu     $s0, $s0, 0x2
/* B569C 8011EF9C 86020000 */  lh        $v0, 0x0($s0)
/* B56A0 8011EFA0 44821000 */  mtc1      $v0, $f2
/* B56A4 8011EFA4 00000000 */  nop
/* B56A8 8011EFA8 468010A0 */  cvt.s.w   $f2, $f2
/* B56AC 8011EFAC 460010A1 */  cvt.d.s   $f2, $f2
/* B56B0 8011EFB0 46241082 */  mul.d     $f2, $f2, $f4
/* B56B4 8011EFB4 00000000 */  nop
/* B56B8 8011EFB8 8E240010 */  lw        $a0, 0x10($s1)
/* B56BC 8011EFBC 26100002 */  addiu     $s0, $s0, 0x2
/* B56C0 8011EFC0 00711821 */  addu      $v1, $v1, $s1
/* B56C4 8011EFC4 86020000 */  lh        $v0, 0x0($s0)
/* B56C8 8011EFC8 90650014 */  lbu       $a1, 0x14($v1)
/* B56CC 8011EFCC 44820000 */  mtc1      $v0, $f0
/* B56D0 8011EFD0 00000000 */  nop
/* B56D4 8011EFD4 46800020 */  cvt.s.w   $f0, $f0
/* B56D8 8011EFD8 46000021 */  cvt.d.s   $f0, $f0
/* B56DC 8011EFDC 46240002 */  mul.d     $f0, $f0, $f4
/* B56E0 8011EFE0 00000000 */  nop
/* B56E4 8011EFE4 3C018015 */  lui       $at, %hi(D_8014FED8)
/* B56E8 8011EFE8 D424FED8 */  ldc1      $f4, %lo(D_8014FED8)($at)
/* B56EC 8011EFEC 26100002 */  addiu     $s0, $s0, 0x2
/* B56F0 8011EFF0 AE300008 */  sw        $s0, 0x8($s1)
/* B56F4 8011EFF4 46243183 */  div.d     $f6, $f6, $f4
/* B56F8 8011EFF8 46203620 */  cvt.s.d   $f24, $f6
/* B56FC 8011EFFC 46241083 */  div.d     $f2, $f2, $f4
/* B5700 8011F000 462015A0 */  cvt.s.d   $f22, $f2
/* B5704 8011F004 46240003 */  div.d     $f0, $f0, $f4
/* B5708 8011F008 0C047837 */  jal       get_animator_child_with_id
/* B570C 8011F00C 46200520 */   cvt.s.d  $f20, $f0
/* B5710 8011F010 0040282D */  daddu     $a1, $v0, $zero
/* B5714 8011F014 14A00003 */  bnez      $a1, .L8011F024
/* B5718 8011F018 24020001 */   addiu    $v0, $zero, 0x1
.L8011F01C:
/* B571C 8011F01C 08047C07 */  j         .L8011F01C
/* B5720 8011F020 00000000 */   nop
.L8011F024:
/* B5724 8011F024 E4B800A8 */  swc1      $f24, 0xA8($a1)
/* B5728 8011F028 E4B600AC */  swc1      $f22, 0xAC($a1)
/* B572C 8011F02C 08047C0E */  j         .L8011F038
/* B5730 8011F030 E4B400B0 */   swc1     $f20, 0xB0($a1)
glabel .L8011F034
/* B5734 8011F034 0000102D */  daddu     $v0, $zero, $zero
.L8011F038:
/* B5738 8011F038 8FBF0018 */  lw        $ra, 0x18($sp)
/* B573C 8011F03C 8FB10014 */  lw        $s1, 0x14($sp)
/* B5740 8011F040 8FB00010 */  lw        $s0, 0x10($sp)
/* B5744 8011F044 D7B80030 */  ldc1      $f24, 0x30($sp)
/* B5748 8011F048 D7B60028 */  ldc1      $f22, 0x28($sp)
/* B574C 8011F04C D7B40020 */  ldc1      $f20, 0x20($sp)
/* B5750 8011F050 03E00008 */  jr        $ra
/* B5754 8011F054 27BD0038 */   addiu    $sp, $sp, 0x38

### DECOMPILED C INSTRUCTIONS:

s32 step_model_animator(ModelAnimator* animator) {
    s16* args = animator->animReadPos;
    AnimatorNode* node;
    f32 x, y, z;
    s32 flags;
    s32 nodeId;

    switch (*args++) {
        case AS_END:
            return -1;
        case AS_SET_RENDER_MODE:
            animator->renderMode = *args++;
            animator->animReadPos = args;
            return 1;
        case AS_WAIT:
            animator->nextUpdateTime = *args++;
            animator->animReadPos = args;
            break;
        case AS_END_LOOP:
            animator->animReadPos = animator->savedReadPos;
            return 1;
        case AS_LOOP:
            animator->animReadPos = animator->savedReadPos = args;
            return 1;
        case AS_SET_FLAGS:
            flags = *args++;
            animator->animReadPos = args;
            animator->flags |= flags & 0xFFFF;
            return 1;
        case AS_SET_NODE_FLAGS:
            node = get_animator_child_with_id(animator->rootNode, animator->staticNodeIDs[*args++ - 1]);
            flags = *args++;
            node->flags |= flags;
            animator->animReadPos = args;
            return 1;
        case AS_CLEAR_NODE_FLAGS:
            node = get_animator_child_with_id(animator->rootNode, animator->staticNodeIDs[*args++ - 1]);
            flags = *args++;
            node->flags &= ~flags;
            animator->animReadPos = args;
            return 1;
        case AS_OP_19:
            animator->flags |= MODEL_ANIMATOR_FLAG_NO_FLIP;
            animator->animReadPos = args;
            return 1;
        case AS_SET_ROTATION:
            nodeId = animator->staticNodeIDs[*args++ - 1];
            x = (f32)*args++ * 180.0 / 32767.0;
            y = (f32)*args++ * 180.0 / 32767.0;
            z = (f32)*args++ * 180.0 / 32767.0;
            animator->animReadPos = args;

            node = get_animator_child_with_id(animator->rootNode, nodeId);
            ASSERT(node != NULL);
            node->rotation.x = x;
            node->rotation.y = y;
            node->rotation.z = z;
            return 1;
        case AS_ADD_ROTATION:
            nodeId = animator->staticNodeIDs[*args++ - 1];
            x = (f32)*args++ * 180.0 / 32767.0;
            y = (f32)*args++ * 180.0 / 32767.0;
            z = (f32)*args++ * 180.0 / 32767.0;
            animator->animReadPos = args;

            node = get_animator_child_with_id(animator->rootNode, nodeId);
            ASSERT(node != NULL);
            node->rotation.x += x;
            node->rotation.y += y;
            node->rotation.z += z;
            return 1;
        case AS_SET_POS:
            nodeId = animator->staticNodeIDs[*args++ - 1];
            x = *args++;
            y = *args++;
            z = *args++;
            animator->animReadPos = args;
            node = get_animator_child_with_id(animator->rootNode, nodeId);
            ASSERT(node != NULL);
            node->pos.x = x;
            node->pos.y = y;
            node->pos.z = z;
            return 1;
        case AS_SET_SCALE:
            nodeId = animator->staticNodeIDs[*args++ - 1];
            x = (f32)*args++ * 180.0 / 32767.0;
            y = (f32)*args++ * 180.0 / 32767.0;
            z = (f32)*args++ * 180.0 / 32767.0;
            animator->animReadPos = args;

            node = get_animator_child_with_id(animator->rootNode, nodeId);
            ASSERT(node != NULL);
            node->scale.x = x;
            node->scale.y = y;
            node->scale.z = z;
            return 1;
    }
    return 0;
}