### RAW ASSEMBLY INSTRUCTIONS:

glabel energy_in_out_main
/* 3D5020 E00D6000 27BDFF78 */  addiu     $sp, $sp, -0x88
/* 3D5024 E00D6004 F7B40060 */  sdc1      $f20, 0x60($sp)
/* 3D5028 E00D6008 4485A000 */  mtc1      $a1, $f20
/* 3D502C E00D600C F7B60068 */  sdc1      $f22, 0x68($sp)
/* 3D5030 E00D6010 4486B000 */  mtc1      $a2, $f22
/* 3D5034 E00D6014 F7B80070 */  sdc1      $f24, 0x70($sp)
/* 3D5038 E00D6018 4487C000 */  mtc1      $a3, $f24
/* 3D503C E00D601C AFB70054 */  sw        $s7, 0x54($sp)
/* 3D5040 E00D6020 0080B82D */  daddu     $s7, $a0, $zero
/* 3D5044 E00D6024 AFB00038 */  sw        $s0, 0x38($sp)
/* 3D5048 E00D6028 8FB0009C */  lw        $s0, 0x9C($sp)
/* 3D504C E00D602C 27A40010 */  addiu     $a0, $sp, 0x10
/* 3D5050 E00D6030 AFBF005C */  sw        $ra, 0x5C($sp)
/* 3D5054 E00D6034 AFBE0058 */  sw        $fp, 0x58($sp)
/* 3D5058 E00D6038 AFB60050 */  sw        $s6, 0x50($sp)
/* 3D505C E00D603C AFB5004C */  sw        $s5, 0x4C($sp)
/* 3D5060 E00D6040 AFB40048 */  sw        $s4, 0x48($sp)
/* 3D5064 E00D6044 AFB30044 */  sw        $s3, 0x44($sp)
/* 3D5068 E00D6048 AFB20040 */  sw        $s2, 0x40($sp)
/* 3D506C E00D604C AFB1003C */  sw        $s1, 0x3C($sp)
/* 3D5070 E00D6050 F7BC0080 */  sdc1      $f28, 0x80($sp)
/* 3D5074 E00D6054 F7BA0078 */  sdc1      $f26, 0x78($sp)
/* 3D5078 E00D6058 3C08E00D */  lui       $t0, (0xE00D6E74 >> 16)
/* 3D507C E00D605C 01174021 */  addu      $t0, $t0, $s7
/* 3D5080 E00D6060 91086E74 */  lbu       $t0, (0xE00D6E74 & 0xFFFF)($t0)
/* 3D5084 E00D6064 3C02E00D */  lui       $v0, %hi(energy_in_out_init)
/* 3D5088 E00D6068 24426718 */  addiu     $v0, $v0, %lo(energy_in_out_init)
/* 3D508C E00D606C AFA20018 */  sw        $v0, 0x18($sp)
/* 3D5090 E00D6070 3C02E00D */  lui       $v0, %hi(energy_in_out_update)
/* 3D5094 E00D6074 24426720 */  addiu     $v0, $v0, %lo(energy_in_out_update)
/* 3D5098 E00D6078 AFA2001C */  sw        $v0, 0x1C($sp)
/* 3D509C E00D607C 3C02E00D */  lui       $v0, %hi(energy_in_out_render)
/* 3D50A0 E00D6080 2442693C */  addiu     $v0, $v0, %lo(energy_in_out_render)
/* 3D50A4 E00D6084 AFA20020 */  sw        $v0, 0x20($sp)
/* 3D50A8 E00D6088 2402006B */  addiu     $v0, $zero, 0x6B
/* 3D50AC E00D608C AFA00010 */  sw        $zero, 0x10($sp)
/* 3D50B0 E00D6090 AFA00024 */  sw        $zero, 0x24($sp)
/* 3D50B4 E00D6094 AFA20014 */  sw        $v0, 0x14($sp)
/* 3D50B8 E00D6098 0C080124 */  jal       shim_create_effect_instance
/* 3D50BC E00D609C AFA8002C */   sw       $t0, 0x2C($sp)
/* 3D50C0 E00D60A0 8FA9002C */  lw        $t1, 0x2C($sp)
/* 3D50C4 E00D60A4 AFA20028 */  sw        $v0, 0x28($sp)
/* 3D50C8 E00D60A8 000920C0 */  sll       $a0, $t1, 3
/* 3D50CC E00D60AC 00892021 */  addu      $a0, $a0, $t1
/* 3D50D0 E00D60B0 000420C0 */  sll       $a0, $a0, 3
/* 3D50D4 E00D60B4 0C08012C */  jal       shim_general_heap_malloc
/* 3D50D8 E00D60B8 AC490008 */   sw       $t1, 0x8($v0)
/* 3D50DC E00D60BC 0040902D */  daddu     $s2, $v0, $zero
/* 3D50E0 E00D60C0 8FA80028 */  lw        $t0, 0x28($sp)
/* 3D50E4 E00D60C4 0240A02D */  daddu     $s4, $s2, $zero
/* 3D50E8 E00D60C8 16400003 */  bnez      $s2, .LE00D60D8
/* 3D50EC E00D60CC AD12000C */   sw       $s2, 0xC($t0)
.LE00D60D0:
/* 3D50F0 E00D60D0 08035834 */  j         .LE00D60D0
/* 3D50F4 E00D60D4 00000000 */   nop
.LE00D60D8:
/* 3D50F8 E00D60D8 AE570000 */  sw        $s7, 0x0($s2)
/* 3D50FC E00D60DC 1E000004 */  bgtz      $s0, .LE00D60F0
/* 3D5100 E00D60E0 AE400014 */   sw       $zero, 0x14($s2)
/* 3D5104 E00D60E4 240203E8 */  addiu     $v0, $zero, 0x3E8
/* 3D5108 E00D60E8 0803583D */  j         .LE00D60F4
/* 3D510C E00D60EC AE420010 */   sw       $v0, 0x10($s2)
.LE00D60F0:
/* 3D5110 E00D60F0 AE500010 */  sw        $s0, 0x10($s2)
.LE00D60F4:
/* 3D5114 E00D60F4 24040168 */  addiu     $a0, $zero, 0x168
/* 3D5118 E00D60F8 AE400024 */  sw        $zero, 0x24($s2)
/* 3D511C E00D60FC E6540004 */  swc1      $f20, 0x4($s2)
/* 3D5120 E00D6100 E6560008 */  swc1      $f22, 0x8($s2)
/* 3D5124 E00D6104 E658000C */  swc1      $f24, 0xC($s2)
/* 3D5128 E00D6108 C7A00098 */  lwc1      $f0, 0x98($sp)
/* 3D512C E00D610C 240200FF */  addiu     $v0, $zero, 0xFF
/* 3D5130 E00D6110 AE420018 */  sw        $v0, 0x18($s2)
/* 3D5134 E00D6114 AE42001C */  sw        $v0, 0x1C($s2)
/* 3D5138 E00D6118 AE420020 */  sw        $v0, 0x20($s2)
/* 3D513C E00D611C AE420028 */  sw        $v0, 0x28($s2)
/* 3D5140 E00D6120 E6400034 */  swc1      $f0, 0x34($s2)
/* 3D5144 E00D6124 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3D5148 E00D6128 44810000 */  mtc1      $at, $f0
/* 3D514C E00D612C 240200F5 */  addiu     $v0, $zero, 0xF5
/* 3D5150 E00D6130 AE42002C */  sw        $v0, 0x2C($s2)
/* 3D5154 E00D6134 AE400030 */  sw        $zero, 0x30($s2)
/* 3D5158 E00D6138 E6400044 */  swc1      $f0, 0x44($s2)
/* 3D515C E00D613C 3C02E00D */  lui       $v0, (0xE00D6E84 >> 16)
/* 3D5160 E00D6140 00571021 */  addu      $v0, $v0, $s7
/* 3D5164 E00D6144 90426E84 */  lbu       $v0, (0xE00D6E84 & 0xFFFF)($v0)
/* 3D5168 E00D6148 24110001 */  addiu     $s1, $zero, 0x1
/* 3D516C E00D614C 44820000 */  mtc1      $v0, $f0
/* 3D5170 E00D6150 00000000 */  nop
/* 3D5174 E00D6154 46800020 */  cvt.s.w   $f0, $f0
/* 3D5178 E00D6158 0C080138 */  jal       shim_rand_int
/* 3D517C E00D615C E6400038 */   swc1     $f0, 0x38($s2)
/* 3D5180 E00D6160 8FA90028 */  lw        $t1, 0x28($sp)
/* 3D5184 E00D6164 8D230008 */  lw        $v1, 0x8($t1)
/* 3D5188 E00D6168 4482E000 */  mtc1      $v0, $f28
/* 3D518C E00D616C 00000000 */  nop
/* 3D5190 E00D6170 4680E720 */  cvt.s.w   $f28, $f28
/* 3D5194 E00D6174 0223182A */  slt       $v1, $s1, $v1
/* 3D5198 E00D6178 10600155 */  beqz      $v1, .LE00D66D0
/* 3D519C E00D617C 26520048 */   addiu    $s2, $s2, 0x48
/* 3D51A0 E00D6180 3C135555 */  lui       $s3, (0x55555556 >> 16)
/* 3D51A4 E00D6184 36735556 */  ori       $s3, $s3, (0x55555556 & 0xFFFF)
/* 3D51A8 E00D6188 24160014 */  addiu     $s6, $zero, 0x14
/* 3D51AC E00D618C 241E000A */  addiu     $fp, $zero, 0xA
/* 3D51B0 E00D6190 2650003C */  addiu     $s0, $s2, 0x3C
/* 3D51B4 E00D6194 0000A82D */  daddu     $s5, $zero, $zero
/* 3D51B8 E00D6198 001717C3 */  sra       $v0, $s7, 31
/* 3D51BC E00D619C 02F30018 */  mult      $s7, $s3
/* 3D51C0 E00D61A0 3C01E00D */  lui       $at, (0xE00D6EA0 >> 16)
/* 3D51C4 E00D61A4 D4366EA0 */  ldc1      $f22, (0xE00D6EA0 & 0xFFFF)($at)
/* 3D51C8 E00D61A8 3C01E00D */  lui       $at, (0xE00D6EA8 >> 16)
/* 3D51CC E00D61AC D43A6EA8 */  ldc1      $f26, (0xE00D6EA8 & 0xFFFF)($at)
/* 3D51D0 E00D61B0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 3D51D4 E00D61B4 4481A800 */  mtc1      $at, $f21
/* 3D51D8 E00D61B8 4480A000 */  mtc1      $zero, $f20
/* 3D51DC E00D61BC 3C01E00D */  lui       $at, (0xE00D6EB0 >> 16)
/* 3D51E0 E00D61C0 D4386EB0 */  ldc1      $f24, (0xE00D6EB0 & 0xFFFF)($at)
/* 3D51E4 E00D61C4 00004010 */  mfhi      $t0
/* 3D51E8 E00D61C8 01024023 */  subu      $t0, $t0, $v0
/* 3D51EC E00D61CC AFA80030 */  sw        $t0, 0x30($sp)
.LE00D61D0:
/* 3D51F0 E00D61D0 8FA90030 */  lw        $t1, 0x30($sp)
/* 3D51F4 E00D61D4 00091040 */  sll       $v0, $t1, 1
/* 3D51F8 E00D61D8 00491021 */  addu      $v0, $v0, $t1
/* 3D51FC E00D61DC 02E21023 */  subu      $v0, $s7, $v0
/* 3D5200 E00D61E0 AE420000 */  sw        $v0, 0x0($s2)
/* 3D5204 E00D61E4 2EE2000D */  sltiu     $v0, $s7, 0xD
/* 3D5208 E00D61E8 1040010C */  beqz      $v0, .LE00D661C
/* 3D520C E00D61EC 00171080 */   sll      $v0, $s7, 2
/* 3D5210 E00D61F0 3C01E00D */  lui       $at, (0xE00D6EB8 >> 16)
/* 3D5214 E00D61F4 00220821 */  addu      $at, $at, $v0
/* 3D5218 E00D61F8 8C226EB8 */  lw        $v0, (0xE00D6EB8 & 0xFFFF)($at)
/* 3D521C E00D61FC 00400008 */  jr        $v0
/* 3D5220 E00D6200 00000000 */   nop
/* 3D5224 E00D6204 0C080138 */  jal       shim_rand_int
/* 3D5228 E00D6208 2404000A */   addiu    $a0, $zero, 0xA
/* 3D522C E00D620C 44821000 */  mtc1      $v0, $f2
/* 3D5230 E00D6210 00000000 */  nop
/* 3D5234 E00D6214 468010A1 */  cvt.d.w   $f2, $f2
/* 3D5238 E00D6218 46361082 */  mul.d     $f2, $f2, $f22
/* 3D523C E00D621C 00000000 */  nop
/* 3D5240 E00D6220 02330018 */  mult      $s1, $s3
/* 3D5244 E00D6224 00111FC3 */  sra       $v1, $s1, 31
/* 3D5248 E00D6228 00004010 */  mfhi      $t0
/* 3D524C E00D622C 01031823 */  subu      $v1, $t0, $v1
/* 3D5250 E00D6230 00031040 */  sll       $v0, $v1, 1
/* 3D5254 E00D6234 00431021 */  addu      $v0, $v0, $v1
/* 3D5258 E00D6238 02221023 */  subu      $v0, $s1, $v0
/* 3D525C E00D623C 44820000 */  mtc1      $v0, $f0
/* 3D5260 E00D6240 00000000 */  nop
/* 3D5264 E00D6244 46800021 */  cvt.d.w   $f0, $f0
/* 3D5268 E00D6248 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D526C E00D624C 00000000 */  nop
/* 3D5270 E00D6250 46361080 */  add.d     $f2, $f2, $f22
/* 3D5274 E00D6254 AE16FFD4 */  sw        $s6, -0x2C($s0)
/* 3D5278 E00D6258 AE000004 */  sw        $zero, 0x4($s0)
/* 3D527C E00D625C 08035982 */  j         .LE00D6608
/* 3D5280 E00D6260 46201087 */   neg.d    $f2, $f2
/* 3D5284 E00D6264 0C080138 */  jal       shim_rand_int
/* 3D5288 E00D6268 2404000A */   addiu    $a0, $zero, 0xA
/* 3D528C E00D626C 44821000 */  mtc1      $v0, $f2
/* 3D5290 E00D6270 00000000 */  nop
/* 3D5294 E00D6274 468010A1 */  cvt.d.w   $f2, $f2
/* 3D5298 E00D6278 46361082 */  mul.d     $f2, $f2, $f22
/* 3D529C E00D627C 00000000 */  nop
/* 3D52A0 E00D6280 02330018 */  mult      $s1, $s3
/* 3D52A4 E00D6284 00111FC3 */  sra       $v1, $s1, 31
/* 3D52A8 E00D6288 00004010 */  mfhi      $t0
/* 3D52AC E00D628C 01031823 */  subu      $v1, $t0, $v1
/* 3D52B0 E00D6290 00031040 */  sll       $v0, $v1, 1
/* 3D52B4 E00D6294 00431021 */  addu      $v0, $v0, $v1
/* 3D52B8 E00D6298 02221023 */  subu      $v0, $s1, $v0
/* 3D52BC E00D629C 44820000 */  mtc1      $v0, $f0
/* 3D52C0 E00D62A0 00000000 */  nop
/* 3D52C4 E00D62A4 46800021 */  cvt.d.w   $f0, $f0
/* 3D52C8 E00D62A8 463A0002 */  mul.d     $f0, $f0, $f26
/* 3D52CC E00D62AC 00000000 */  nop
/* 3D52D0 E00D62B0 46361080 */  add.d     $f2, $f2, $f22
/* 3D52D4 E00D62B4 AE16FFD4 */  sw        $s6, -0x2C($s0)
/* 3D52D8 E00D62B8 08035982 */  j         .LE00D6608
/* 3D52DC E00D62BC AE000004 */   sw       $zero, 0x4($s0)
/* 3D52E0 E00D62C0 0C080138 */  jal       shim_rand_int
/* 3D52E4 E00D62C4 2404000A */   addiu    $a0, $zero, 0xA
/* 3D52E8 E00D62C8 02330018 */  mult      $s1, $s3
/* 3D52EC E00D62CC 001127C3 */  sra       $a0, $s1, 31
/* 3D52F0 E00D62D0 00004010 */  mfhi      $t0
/* 3D52F4 E00D62D4 01042023 */  subu      $a0, $t0, $a0
/* 3D52F8 E00D62D8 00041840 */  sll       $v1, $a0, 1
/* 3D52FC E00D62DC 00641821 */  addu      $v1, $v1, $a0
/* 3D5300 E00D62E0 02231823 */  subu      $v1, $s1, $v1
/* 3D5304 E00D62E4 44830000 */  mtc1      $v1, $f0
/* 3D5308 E00D62E8 00000000 */  nop
/* 3D530C E00D62EC 46800021 */  cvt.d.w   $f0, $f0
/* 3D5310 E00D62F0 46380002 */  mul.d     $f0, $f0, $f24
/* 3D5314 E00D62F4 00000000 */  nop
/* 3D5318 E00D62F8 24420004 */  addiu     $v0, $v0, 0x4
/* 3D531C E00D62FC 00021023 */  negu      $v0, $v0
/* 3D5320 E00D6300 44821000 */  mtc1      $v0, $f2
/* 3D5324 E00D6304 00000000 */  nop
/* 3D5328 E00D6308 468010A0 */  cvt.s.w   $f2, $f2
/* 3D532C E00D630C E602FFFC */  swc1      $f2, -0x4($s0)
/* 3D5330 E00D6310 4620A001 */  sub.d     $f0, $f20, $f0
/* 3D5334 E00D6314 AE1EFFD4 */  sw        $fp, -0x2C($s0)
/* 3D5338 E00D6318 08035985 */  j         .LE00D6614
/* 3D533C E00D631C AE000004 */   sw       $zero, 0x4($s0)
/* 3D5340 E00D6320 0C080138 */  jal       shim_rand_int
/* 3D5344 E00D6324 2404000A */   addiu    $a0, $zero, 0xA
/* 3D5348 E00D6328 02330018 */  mult      $s1, $s3
/* 3D534C E00D632C 001127C3 */  sra       $a0, $s1, 31
/* 3D5350 E00D6330 00004010 */  mfhi      $t0
/* 3D5354 E00D6334 01042023 */  subu      $a0, $t0, $a0
/* 3D5358 E00D6338 00041840 */  sll       $v1, $a0, 1
/* 3D535C E00D633C 00641821 */  addu      $v1, $v1, $a0
/* 3D5360 E00D6340 02231823 */  subu      $v1, $s1, $v1
/* 3D5364 E00D6344 44830000 */  mtc1      $v1, $f0
/* 3D5368 E00D6348 00000000 */  nop
/* 3D536C E00D634C 46800021 */  cvt.d.w   $f0, $f0
/* 3D5370 E00D6350 46380002 */  mul.d     $f0, $f0, $f24
/* 3D5374 E00D6354 00000000 */  nop
/* 3D5378 E00D6358 24420004 */  addiu     $v0, $v0, 0x4
/* 3D537C E00D635C 00021023 */  negu      $v0, $v0
/* 3D5380 E00D6360 44821000 */  mtc1      $v0, $f2
/* 3D5384 E00D6364 00000000 */  nop
/* 3D5388 E00D6368 468010A0 */  cvt.s.w   $f2, $f2
/* 3D538C E00D636C E602FFFC */  swc1      $f2, -0x4($s0)
/* 3D5390 E00D6370 4620A001 */  sub.d     $f0, $f20, $f0
/* 3D5394 E00D6374 AE1EFFD4 */  sw        $fp, -0x2C($s0)
/* 3D5398 E00D6378 08035985 */  j         .LE00D6614
/* 3D539C E00D637C AE000004 */   sw       $zero, 0x4($s0)
/* 3D53A0 E00D6380 0C080138 */  jal       shim_rand_int
/* 3D53A4 E00D6384 2404000A */   addiu    $a0, $zero, 0xA
/* 3D53A8 E00D6388 44821000 */  mtc1      $v0, $f2
/* 3D53AC E00D638C 00000000 */  nop
/* 3D53B0 E00D6390 468010A1 */  cvt.d.w   $f2, $f2
/* 3D53B4 E00D6394 46361082 */  mul.d     $f2, $f2, $f22
/* 3D53B8 E00D6398 00000000 */  nop
/* 3D53BC E00D639C 02330018 */  mult      $s1, $s3
/* 3D53C0 E00D63A0 00111FC3 */  sra       $v1, $s1, 31
/* 3D53C4 E00D63A4 00004010 */  mfhi      $t0
/* 3D53C8 E00D63A8 01031823 */  subu      $v1, $t0, $v1
/* 3D53CC E00D63AC 00031040 */  sll       $v0, $v1, 1
/* 3D53D0 E00D63B0 00431021 */  addu      $v0, $v0, $v1
/* 3D53D4 E00D63B4 02221023 */  subu      $v0, $s1, $v0
/* 3D53D8 E00D63B8 44820000 */  mtc1      $v0, $f0
/* 3D53DC E00D63BC 00000000 */  nop
/* 3D53E0 E00D63C0 46800021 */  cvt.d.w   $f0, $f0
/* 3D53E4 E00D63C4 46380002 */  mul.d     $f0, $f0, $f24
/* 3D53E8 E00D63C8 00000000 */  nop
/* 3D53EC E00D63CC 3C01E00D */  lui       $at, (0xE00D6EF0 >> 16)
/* 3D53F0 E00D63D0 D4246EF0 */  ldc1      $f4, (0xE00D6EF0 & 0xFFFF)($at)
/* 3D53F4 E00D63D4 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 3D53F8 E00D63D8 44813000 */  mtc1      $at, $f6
/* 3D53FC E00D63DC 08035980 */  j         .LE00D6600
/* 3D5400 E00D63E0 46241080 */   add.d    $f2, $f2, $f4
/* 3D5404 E00D63E4 0C080138 */  jal       shim_rand_int
/* 3D5408 E00D63E8 2404000A */   addiu    $a0, $zero, 0xA
/* 3D540C E00D63EC 44821000 */  mtc1      $v0, $f2
/* 3D5410 E00D63F0 00000000 */  nop
/* 3D5414 E00D63F4 468010A1 */  cvt.d.w   $f2, $f2
/* 3D5418 E00D63F8 46361082 */  mul.d     $f2, $f2, $f22
/* 3D541C E00D63FC 00000000 */  nop
/* 3D5420 E00D6400 02330018 */  mult      $s1, $s3
/* 3D5424 E00D6404 00111FC3 */  sra       $v1, $s1, 31
/* 3D5428 E00D6408 00004010 */  mfhi      $t0
/* 3D542C E00D640C 01031823 */  subu      $v1, $t0, $v1
/* 3D5430 E00D6410 00031040 */  sll       $v0, $v1, 1
/* 3D5434 E00D6414 00431021 */  addu      $v0, $v0, $v1
/* 3D5438 E00D6418 02221023 */  subu      $v0, $s1, $v0
/* 3D543C E00D641C 44820000 */  mtc1      $v0, $f0
/* 3D5440 E00D6420 00000000 */  nop
/* 3D5444 E00D6424 46800021 */  cvt.d.w   $f0, $f0
/* 3D5448 E00D6428 46380002 */  mul.d     $f0, $f0, $f24
/* 3D544C E00D642C 00000000 */  nop
/* 3D5450 E00D6430 3C01E00D */  lui       $at, (0xE00D6EF8 >> 16)
/* 3D5454 E00D6434 D4246EF8 */  ldc1      $f4, (0xE00D6EF8 & 0xFFFF)($at)
/* 3D5458 E00D6438 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 3D545C E00D643C 44813000 */  mtc1      $at, $f6
/* 3D5460 E00D6440 AE16FFD4 */  sw        $s6, -0x2C($s0)
/* 3D5464 E00D6444 46241080 */  add.d     $f2, $f2, $f4
/* 3D5468 E00D6448 E6060004 */  swc1      $f6, 0x4($s0)
/* 3D546C E00D644C 240200FF */  addiu     $v0, $zero, 0xFF
/* 3D5470 E00D6450 46201087 */  neg.d     $f2, $f2
/* 3D5474 E00D6454 4620A001 */  sub.d     $f0, $f20, $f0
/* 3D5478 E00D6458 462010A0 */  cvt.s.d   $f2, $f2
/* 3D547C E00D645C E602FFFC */  swc1      $f2, -0x4($s0)
/* 3D5480 E00D6460 46200020 */  cvt.s.d   $f0, $f0
/* 3D5484 E00D6464 E600FFF8 */  swc1      $f0, -0x8($s0)
/* 3D5488 E00D6468 AE820018 */  sw        $v0, 0x18($s4)
/* 3D548C E00D646C 240200F5 */  addiu     $v0, $zero, 0xF5
/* 3D5490 E00D6470 AE82001C */  sw        $v0, 0x1C($s4)
/* 3D5494 E00D6474 240200D7 */  addiu     $v0, $zero, 0xD7
/* 3D5498 E00D6478 AE820020 */  sw        $v0, 0x20($s4)
/* 3D549C E00D647C 240200DC */  addiu     $v0, $zero, 0xDC
/* 3D54A0 E00D6480 AE820028 */  sw        $v0, 0x28($s4)
/* 3D54A4 E00D6484 2402003C */  addiu     $v0, $zero, 0x3C
/* 3D54A8 E00D6488 AE82002C */  sw        $v0, 0x2C($s4)
/* 3D54AC E00D648C 08035987 */  j         .LE00D661C
/* 3D54B0 E00D6490 AE9E0030 */   sw       $fp, 0x30($s4)
/* 3D54B4 E00D6494 0C080138 */  jal       shim_rand_int
/* 3D54B8 E00D6498 2404000A */   addiu    $a0, $zero, 0xA
/* 3D54BC E00D649C 44821000 */  mtc1      $v0, $f2
/* 3D54C0 E00D64A0 00000000 */  nop
/* 3D54C4 E00D64A4 468010A1 */  cvt.d.w   $f2, $f2
/* 3D54C8 E00D64A8 463A1082 */  mul.d     $f2, $f2, $f26
/* 3D54CC E00D64AC 00000000 */  nop
/* 3D54D0 E00D64B0 02330018 */  mult      $s1, $s3
/* 3D54D4 E00D64B4 001127C3 */  sra       $a0, $s1, 31
/* 3D54D8 E00D64B8 00004010 */  mfhi      $t0
/* 3D54DC E00D64BC 01042023 */  subu      $a0, $t0, $a0
/* 3D54E0 E00D64C0 00041840 */  sll       $v1, $a0, 1
/* 3D54E4 E00D64C4 00641821 */  addu      $v1, $v1, $a0
/* 3D54E8 E00D64C8 02231823 */  subu      $v1, $s1, $v1
/* 3D54EC E00D64CC 44832000 */  mtc1      $v1, $f4
/* 3D54F0 E00D64D0 00000000 */  nop
/* 3D54F4 E00D64D4 46802121 */  cvt.d.w   $f4, $f4
/* 3D54F8 E00D64D8 46382102 */  mul.d     $f4, $f4, $f24
/* 3D54FC E00D64DC 00000000 */  nop
/* 3D5500 E00D64E0 4624A101 */  sub.d     $f4, $f20, $f4
/* 3D5504 E00D64E4 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3D5508 E00D64E8 44810800 */  mtc1      $at, $f1
/* 3D550C E00D64EC 44800000 */  mtc1      $zero, $f0
/* 3D5510 E00D64F0 00000000 */  nop
/* 3D5514 E00D64F4 46202102 */  mul.d     $f4, $f4, $f0
/* 3D5518 E00D64F8 00000000 */  nop
/* 3D551C E00D64FC 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 3D5520 E00D6500 44810800 */  mtc1      $at, $f1
/* 3D5524 E00D6504 44800000 */  mtc1      $zero, $f0
/* 3D5528 E00D6508 00000000 */  nop
/* 3D552C E00D650C 46201080 */  add.d     $f2, $f2, $f0
/* 3D5530 E00D6510 AE1EFFD4 */  sw        $fp, -0x2C($s0)
/* 3D5534 E00D6514 AE000004 */  sw        $zero, 0x4($s0)
/* 3D5538 E00D6518 462010A0 */  cvt.s.d   $f2, $f2
/* 3D553C E00D651C E602FFFC */  swc1      $f2, -0x4($s0)
/* 3D5540 E00D6520 46202120 */  cvt.s.d   $f4, $f4
/* 3D5544 E00D6524 08035987 */  j         .LE00D661C
/* 3D5548 E00D6528 E604FFF8 */   swc1     $f4, -0x8($s0)
/* 3D554C E00D652C 0C080138 */  jal       shim_rand_int
/* 3D5550 E00D6530 2404000A */   addiu    $a0, $zero, 0xA
/* 3D5554 E00D6534 3C01E00D */  lui       $at, (0xE00D6F00 >> 16)
/* 3D5558 E00D6538 D4206F00 */  ldc1      $f0, (0xE00D6F00 & 0xFFFF)($at)
/* 3D555C E00D653C 44821000 */  mtc1      $v0, $f2
/* 3D5560 E00D6540 00000000 */  nop
/* 3D5564 E00D6544 468010A1 */  cvt.d.w   $f2, $f2
/* 3D5568 E00D6548 46201082 */  mul.d     $f2, $f2, $f0
/* 3D556C E00D654C 00000000 */  nop
/* 3D5570 E00D6550 02330018 */  mult      $s1, $s3
/* 3D5574 E00D6554 00111FC3 */  sra       $v1, $s1, 31
/* 3D5578 E00D6558 00004010 */  mfhi      $t0
/* 3D557C E00D655C 01031823 */  subu      $v1, $t0, $v1
/* 3D5580 E00D6560 00031040 */  sll       $v0, $v1, 1
/* 3D5584 E00D6564 00431021 */  addu      $v0, $v0, $v1
/* 3D5588 E00D6568 02221023 */  subu      $v0, $s1, $v0
/* 3D558C E00D656C 44820000 */  mtc1      $v0, $f0
/* 3D5590 E00D6570 00000000 */  nop
/* 3D5594 E00D6574 46800021 */  cvt.d.w   $f0, $f0
/* 3D5598 E00D6578 46380002 */  mul.d     $f0, $f0, $f24
/* 3D559C E00D657C 00000000 */  nop
/* 3D55A0 E00D6580 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* 3D55A4 E00D6584 44812000 */  mtc1      $at, $f4
/* 3D55A8 E00D6588 00000000 */  nop
/* 3D55AC E00D658C E6040004 */  swc1      $f4, 0x4($s0)
/* 3D55B0 E00D6590 46361080 */  add.d     $f2, $f2, $f22
/* 3D55B4 E00D6594 2402001E */  addiu     $v0, $zero, 0x1E
/* 3D55B8 E00D6598 08035982 */  j         .LE00D6608
/* 3D55BC E00D659C AE02FFD4 */   sw       $v0, -0x2C($s0)
/* 3D55C0 E00D65A0 0C080138 */  jal       shim_rand_int
/* 3D55C4 E00D65A4 2404000A */   addiu    $a0, $zero, 0xA
/* 3D55C8 E00D65A8 44821000 */  mtc1      $v0, $f2
/* 3D55CC E00D65AC 00000000 */  nop
/* 3D55D0 E00D65B0 468010A1 */  cvt.d.w   $f2, $f2
/* 3D55D4 E00D65B4 46361082 */  mul.d     $f2, $f2, $f22
/* 3D55D8 E00D65B8 00000000 */  nop
/* 3D55DC E00D65BC 02330018 */  mult      $s1, $s3
/* 3D55E0 E00D65C0 00111FC3 */  sra       $v1, $s1, 31
/* 3D55E4 E00D65C4 00004010 */  mfhi      $t0
/* 3D55E8 E00D65C8 01031823 */  subu      $v1, $t0, $v1
/* 3D55EC E00D65CC 00031040 */  sll       $v0, $v1, 1
/* 3D55F0 E00D65D0 00431021 */  addu      $v0, $v0, $v1
/* 3D55F4 E00D65D4 02221023 */  subu      $v0, $s1, $v0
/* 3D55F8 E00D65D8 44820000 */  mtc1      $v0, $f0
/* 3D55FC E00D65DC 00000000 */  nop
/* 3D5600 E00D65E0 46800021 */  cvt.d.w   $f0, $f0
/* 3D5604 E00D65E4 46380002 */  mul.d     $f0, $f0, $f24
/* 3D5608 E00D65E8 00000000 */  nop
/* 3D560C E00D65EC 3C01E00D */  lui       $at, (0xE00D6F08 >> 16)
/* 3D5610 E00D65F0 D4246F08 */  ldc1      $f4, (0xE00D6F08 & 0xFFFF)($at)
/* 3D5614 E00D65F4 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 3D5618 E00D65F8 44813000 */  mtc1      $at, $f6
/* 3D561C E00D65FC 46241080 */  add.d     $f2, $f2, $f4
.LE00D6600:
/* 3D5620 E00D6600 AE16FFD4 */  sw        $s6, -0x2C($s0)
/* 3D5624 E00D6604 E6060004 */  swc1      $f6, 0x4($s0)
.LE00D6608:
/* 3D5628 E00D6608 4620A001 */  sub.d     $f0, $f20, $f0
/* 3D562C E00D660C 462010A0 */  cvt.s.d   $f2, $f2
/* 3D5630 E00D6610 E602FFFC */  swc1      $f2, -0x4($s0)
.LE00D6614:
/* 3D5634 E00D6614 46200020 */  cvt.s.d   $f0, $f0
/* 3D5638 E00D6618 E600FFF8 */  swc1      $f0, -0x8($s0)
.LE00D661C:
/* 3D563C E00D661C 0C080138 */  jal       shim_rand_int
/* 3D5640 E00D6620 8E04FFD4 */   lw       $a0, -0x2C($s0)
/* 3D5644 E00D6624 C602FFFC */  lwc1      $f2, -0x4($s0)
/* 3D5648 E00D6628 44800000 */  mtc1      $zero, $f0
/* 3D564C E00D662C 00021823 */  negu      $v1, $v0
/* 3D5650 E00D6630 4600103C */  c.lt.s    $f2, $f0
/* 3D5654 E00D6634 00000000 */  nop
/* 3D5658 E00D6638 45000004 */  bc1f      .LE00D664C
/* 3D565C E00D663C AE03FFD8 */   sw       $v1, -0x28($s0)
/* 3D5660 E00D6640 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3D5664 E00D6644 46001087 */  neg.s     $f2, $f2
/* 3D5668 E00D6648 00431023 */  subu      $v0, $v0, $v1
.LE00D664C:
/* 3D566C E00D664C 44820000 */  mtc1      $v0, $f0
/* 3D5670 E00D6650 00000000 */  nop
/* 3D5674 E00D6654 46800020 */  cvt.s.w   $f0, $f0
/* 3D5678 E00D6658 46020002 */  mul.s     $f0, $f0, $f2
/* 3D567C E00D665C 00000000 */  nop
/* 3D5680 E00D6660 E600FFC8 */  swc1      $f0, -0x38($s0)
/* 3D5684 E00D6664 8FA9002C */  lw        $t1, 0x2C($sp)
/* 3D5688 E00D6668 2522FFFF */  addiu     $v0, $t1, -0x1
/* 3D568C E00D666C 14400002 */  bnez      $v0, .LE00D6678
/* 3D5690 E00D6670 02A2001A */   div      $zero, $s5, $v0
/* 3D5694 E00D6674 0007000D */  break     7
.LE00D6678:
/* 3D5698 E00D6678 2401FFFF */  addiu     $at, $zero, -0x1
/* 3D569C E00D667C 14410004 */  bne       $v0, $at, .LE00D6690
/* 3D56A0 E00D6680 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 3D56A4 E00D6684 16A10002 */  bne       $s5, $at, .LE00D6690
/* 3D56A8 E00D6688 00000000 */   nop
/* 3D56AC E00D668C 0006000D */  break     6
.LE00D6690:
/* 3D56B0 E00D6690 00001012 */  mflo      $v0
/* 3D56B4 E00D6694 26310001 */  addiu     $s1, $s1, 0x1
/* 3D56B8 E00D6698 26520048 */  addiu     $s2, $s2, 0x48
/* 3D56BC E00D669C 44820000 */  mtc1      $v0, $f0
/* 3D56C0 E00D66A0 00000000 */  nop
/* 3D56C4 E00D66A4 46800020 */  cvt.s.w   $f0, $f0
/* 3D56C8 E00D66A8 461C0000 */  add.s     $f0, $f0, $f28
/* 3D56CC E00D66AC AE00FFCC */  sw        $zero, -0x34($s0)
/* 3D56D0 E00D66B0 AE00FFD0 */  sw        $zero, -0x30($s0)
/* 3D56D4 E00D66B4 E6000000 */  swc1      $f0, 0x0($s0)
/* 3D56D8 E00D66B8 8FA80028 */  lw        $t0, 0x28($sp)
/* 3D56DC E00D66BC 26B50168 */  addiu     $s5, $s5, 0x168
/* 3D56E0 E00D66C0 8D020008 */  lw        $v0, 0x8($t0)
/* 3D56E4 E00D66C4 0222102A */  slt       $v0, $s1, $v0
/* 3D56E8 E00D66C8 1440FEC1 */  bnez      $v0, .LE00D61D0
/* 3D56EC E00D66CC 26100048 */   addiu    $s0, $s0, 0x48
.LE00D66D0:
/* 3D56F0 E00D66D0 8FA20028 */  lw        $v0, 0x28($sp)
/* 3D56F4 E00D66D4 8FBF005C */  lw        $ra, 0x5C($sp)
/* 3D56F8 E00D66D8 8FBE0058 */  lw        $fp, 0x58($sp)
/* 3D56FC E00D66DC 8FB70054 */  lw        $s7, 0x54($sp)
/* 3D5700 E00D66E0 8FB60050 */  lw        $s6, 0x50($sp)
/* 3D5704 E00D66E4 8FB5004C */  lw        $s5, 0x4C($sp)
/* 3D5708 E00D66E8 8FB40048 */  lw        $s4, 0x48($sp)
/* 3D570C E00D66EC 8FB30044 */  lw        $s3, 0x44($sp)
/* 3D5710 E00D66F0 8FB20040 */  lw        $s2, 0x40($sp)
/* 3D5714 E00D66F4 8FB1003C */  lw        $s1, 0x3C($sp)
/* 3D5718 E00D66F8 8FB00038 */  lw        $s0, 0x38($sp)
/* 3D571C E00D66FC D7BC0080 */  ldc1      $f28, 0x80($sp)
/* 3D5720 E00D6700 D7BA0078 */  ldc1      $f26, 0x78($sp)
/* 3D5724 E00D6704 D7B80070 */  ldc1      $f24, 0x70($sp)
/* 3D5728 E00D6708 D7B60068 */  ldc1      $f22, 0x68($sp)
/* 3D572C E00D670C D7B40060 */  ldc1      $f20, 0x60($sp)
/* 3D5730 E00D6710 03E00008 */  jr        $ra
/* 3D5734 E00D6714 27BD0088 */   addiu    $sp, $sp, 0x88

### DECOMPILED C INSTRUCTIONS:

EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
    EffectBlueprint bp;
    EffectInstance* effect;
    EnergyInOutFXData* part;
    EnergyInOutFXData* firstPart;
    s32 numParts = D_E00D6E74[arg0];
    f32 randAngle;
    s32 i;

    bp.init = energy_in_out_init;
    bp.update = energy_in_out_update;
    bp.renderWorld = energy_in_out_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_ENERGY_IN_OUT;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = numParts;
    firstPart = part = effect->data.energyInOut = shim_general_heap_malloc(numParts * sizeof(*part));
    ASSERT(effect->data.energyInOut != NULL);

    part->unk_00 = arg0;
    part->unk_14 = 0;
    if (arg5 <= 0) {
        part->unk_10 = 1000;
    } else {
        part->unk_10 = arg5;
    }
    part->unk_24 = 0;
    part->pos.x = arg1;
    part->pos.y = arg2;
    part->pos.z = arg3;
    part->scale = arg4;
    part->unk_18 = 255;
    part->unk_1C = 255;
    part->unk_20 = 255;
    part->unk_28 = 255;
    part->unk_2C = 245;
    part->unk_30 = 0;
    part->unk_44 = 1.0f;
    part->unk_38 = D_E00D6E84[arg0];

    randAngle = shim_rand_int(360);

    part++;
    for (i = 1; i < effect->numParts; i++, part++) {
        part->unk_00 = arg0 % 3;

        switch (arg0) {
            case 0:
            case 1:
            case 2:
                part->unk_38 = -(shim_rand_int(10) * 0.2 + 0.2);
                part->unk_10 = 20;
                part->unk_40 = 0;
                part->scale = 1.0 - (i % 3) * 0.1;
                break;
            case 3:
            case 5:
                part->unk_38 = shim_rand_int(10) * 0.2 + 0.2;
                part->unk_10 = 20;
                part->unk_40 = 0;
                part->scale = 1.0 - (i % 3) * 0.1;
                break;
            case 6:
                part->unk_38 = -(shim_rand_int(10) + 4);
                part->unk_10 = 10;
                part->unk_40 = 0;
                part->scale = 1.0 - (i % 3) * 0.3;
                break;
            case 7:
                part->unk_38 = -(shim_rand_int(10) + 4);
                part->unk_10 = 10;
                part->unk_40 = 0;
                part->scale = 1.0 - (i % 3) * 0.3;
                break;
            case 8:
                part->unk_38 = shim_rand_int(10) * 0.2 + 0.6;
                part->unk_10 = 20;
                part->unk_40 = -1.0f;
                part->scale = 1.0 - (i % 3) * 0.3;
                break;
            case 9:
                part->unk_38 = -(shim_rand_int(10) * 0.2 + 0.6);
                part->unk_10 = 20;
                part->unk_40 = -2.0f;
                part->scale = 1.0 - (i % 3) * 0.3;
                firstPart->unk_18 = 255;
                firstPart->unk_1C = 245;
                firstPart->unk_20 = 215;
                firstPart->unk_28 = 220;
                firstPart->unk_2C = 60;
                firstPart->unk_30 = 10;
                break;
            case 10:
                part->unk_38 = shim_rand_int(10) * 0.1 + 2.0;
                part->unk_10 = 10;
                part->unk_40 = 0;
                part->scale = (1.0 - (i % 3) * 0.3) * 0.5;
                break;
            case 11:
                part->unk_38 = shim_rand_int(10) * 0.05 + 0.2;
                part->unk_40 = -1.0f;
                part->unk_10 = 30;
                part->scale = 1.0 - (i % 3) * 0.3;
                break;
            case 4:
            case 12:
                part->unk_38 = shim_rand_int(10) * 0.2 + 0.6;
                part->unk_10 = 20;
                part->unk_40 = -2.0f;
                part->scale = 1.0 - (i % 3) * 0.3;
                break;
        }

        part->unk_14 = -shim_rand_int(part->unk_10);

        if (part->unk_38 < 0.0f) {
            part->pos.x = (part->unk_10 - part->unk_14) * (-part->unk_38);
        } else {
            part->pos.x = (-part->unk_14) * part->unk_38;
        }
        part->pos.y = 0;
        part->pos.z = 0;

        part->unk_3C = (i - 1) * 360 / (numParts - 1) + randAngle;
    }

    return effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel water_fountain_appendGfx
/* 3B7D88 E00B8208 27BDFEF8 */  addiu     $sp, $sp, -0x108
/* 3B7D8C E00B820C 0080302D */  daddu     $a2, $a0, $zero
/* 3B7D90 E00B8210 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3B7D94 E00B8214 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3B7D98 E00B8218 3C04800B */  lui       $a0, %hi(gCameras)
/* 3B7D9C E00B821C 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* 3B7DA0 E00B8220 AFBF00EC */  sw        $ra, 0xEC($sp)
/* 3B7DA4 E00B8224 AFBE00E8 */  sw        $fp, 0xE8($sp)
/* 3B7DA8 E00B8228 AFB700E4 */  sw        $s7, 0xE4($sp)
/* 3B7DAC E00B822C AFB600E0 */  sw        $s6, 0xE0($sp)
/* 3B7DB0 E00B8230 AFB500DC */  sw        $s5, 0xDC($sp)
/* 3B7DB4 E00B8234 AFB400D8 */  sw        $s4, 0xD8($sp)
/* 3B7DB8 E00B8238 AFB300D4 */  sw        $s3, 0xD4($sp)
/* 3B7DBC E00B823C AFB200D0 */  sw        $s2, 0xD0($sp)
/* 3B7DC0 E00B8240 AFB100CC */  sw        $s1, 0xCC($sp)
/* 3B7DC4 E00B8244 AFB000C8 */  sw        $s0, 0xC8($sp)
/* 3B7DC8 E00B8248 F7B80100 */  sdc1      $f24, 0x100($sp)
/* 3B7DCC E00B824C F7B600F8 */  sdc1      $f22, 0xF8($sp)
/* 3B7DD0 E00B8250 F7B400F0 */  sdc1      $f20, 0xF0($sp)
/* 3B7DD4 E00B8254 8CD3000C */  lw        $s3, 0xC($a2)
/* 3B7DD8 E00B8258 00031080 */  sll       $v0, $v1, 2
/* 3B7DDC E00B825C 00431021 */  addu      $v0, $v0, $v1
/* 3B7DE0 E00B8260 00021080 */  sll       $v0, $v0, 2
/* 3B7DE4 E00B8264 00431023 */  subu      $v0, $v0, $v1
/* 3B7DE8 E00B8268 000218C0 */  sll       $v1, $v0, 3
/* 3B7DEC E00B826C 00431021 */  addu      $v0, $v0, $v1
/* 3B7DF0 E00B8270 8E7E0014 */  lw        $fp, 0x14($s3)
/* 3B7DF4 E00B8274 8E6A0010 */  lw        $t2, 0x10($s3)
/* 3B7DF8 E00B8278 000210C0 */  sll       $v0, $v0, 3
/* 3B7DFC E00B827C AFAA0098 */  sw        $t2, 0x98($sp)
/* 3B7E00 E00B8280 8E6A0024 */  lw        $t2, 0x24($s3)
/* 3B7E04 E00B8284 0044B821 */  addu      $s7, $v0, $a0
/* 3B7E08 E00B8288 AFAA00A0 */  sw        $t2, 0xA0($sp)
/* 3B7E0C E00B828C 8E6A0018 */  lw        $t2, 0x18($s3)
/* 3B7E10 E00B8290 8E620000 */  lw        $v0, 0x0($s3)
/* 3B7E14 E00B8294 AFAA00A4 */  sw        $t2, 0xA4($sp)
/* 3B7E18 E00B8298 8E6A001C */  lw        $t2, 0x1C($s3)
/* 3B7E1C E00B829C AFAA00A8 */  sw        $t2, 0xA8($sp)
/* 3B7E20 E00B82A0 8E6A0020 */  lw        $t2, 0x20($s3)
/* 3B7E24 E00B82A4 14400007 */  bnez      $v0, .LE00B82C4
/* 3B7E28 E00B82A8 AFAA00AC */   sw       $t2, 0xAC($sp)
/* 3B7E2C E00B82AC 240A0003 */  addiu     $t2, $zero, 0x3
/* 3B7E30 E00B82B0 AFAA00B0 */  sw        $t2, 0xB0($sp)
/* 3B7E34 E00B82B4 3C0AE00C */  lui       $t2, %hi(D_E00B8900)
/* 3B7E38 E00B82B8 254A8900 */  addiu     $t2, $t2, %lo(D_E00B8900)
/* 3B7E3C E00B82BC 0802E0B6 */  j         .LE00B82D8
/* 3B7E40 E00B82C0 24160014 */   addiu    $s6, $zero, 0x14
.LE00B82C4:
/* 3B7E44 E00B82C4 2416000B */  addiu     $s6, $zero, 0xB
/* 3B7E48 E00B82C8 240A0003 */  addiu     $t2, $zero, 0x3
/* 3B7E4C E00B82CC AFAA00B0 */  sw        $t2, 0xB0($sp)
/* 3B7E50 E00B82D0 3C0AE00C */  lui       $t2, %hi(D_E00B8B58)
/* 3B7E54 E00B82D4 254A8B58 */  addiu     $t2, $t2, %lo(D_E00B8B58)
.LE00B82D8:
/* 3B7E58 E00B82D8 AFAA00B4 */  sw        $t2, 0xB4($sp)
/* 3B7E5C E00B82DC 3C05DB06 */  lui       $a1, (0xDB060024 >> 16)
/* 3B7E60 E00B82E0 34A50024 */  ori       $a1, $a1, (0xDB060024 & 0xFFFF)
/* 3B7E64 E00B82E4 27A40018 */  addiu     $a0, $sp, 0x18
/* 3B7E68 E00B82E8 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 3B7E6C E00B82EC 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 3B7E70 E00B82F0 3C120001 */  lui       $s2, (0x11630 >> 16)
/* 3B7E74 E00B82F4 8E880000 */  lw        $t0, 0x0($s4)
/* 3B7E78 E00B82F8 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3B7E7C E00B82FC 0100182D */  daddu     $v1, $t0, $zero
/* 3B7E80 E00B8300 25080008 */  addiu     $t0, $t0, 0x8
/* 3B7E84 E00B8304 AC620000 */  sw        $v0, 0x0($v1)
/* 3B7E88 E00B8308 AC600004 */  sw        $zero, 0x4($v1)
/* 3B7E8C E00B830C AD050000 */  sw        $a1, 0x0($t0)
/* 3B7E90 E00B8310 8CC20010 */  lw        $v0, 0x10($a2)
/* 3B7E94 E00B8314 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 3B7E98 E00B8318 AE880000 */  sw        $t0, 0x0($s4)
/* 3B7E9C E00B831C 8C42001C */  lw        $v0, 0x1C($v0)
/* 3B7EA0 E00B8320 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3B7EA4 E00B8324 00431021 */  addu      $v0, $v0, $v1
/* 3B7EA8 E00B8328 AD020004 */  sw        $v0, 0x4($t0)
/* 3B7EAC E00B832C 8E650004 */  lw        $a1, 0x4($s3)
/* 3B7EB0 E00B8330 8E660008 */  lw        $a2, 0x8($s3)
/* 3B7EB4 E00B8334 8E67000C */  lw        $a3, 0xC($s3)
/* 3B7EB8 E00B8338 25080008 */  addiu     $t0, $t0, 0x8
/* 3B7EBC E00B833C 0C080108 */  jal       shim_guTranslateF
/* 3B7EC0 E00B8340 AE880000 */   sw       $t0, 0x0($s4)
/* 3B7EC4 E00B8344 27B50058 */  addiu     $s5, $sp, 0x58
/* 3B7EC8 E00B8348 8E650034 */  lw        $a1, 0x34($s3)
/* 3B7ECC E00B834C 02A0202D */  daddu     $a0, $s5, $zero
/* 3B7ED0 E00B8350 00A0302D */  daddu     $a2, $a1, $zero
/* 3B7ED4 E00B8354 0C080110 */  jal       shim_guScaleF
/* 3B7ED8 E00B8358 00A0382D */   daddu    $a3, $a1, $zero
/* 3B7EDC E00B835C 02A0202D */  daddu     $a0, $s5, $zero
/* 3B7EE0 E00B8360 27A50018 */  addiu     $a1, $sp, 0x18
/* 3B7EE4 E00B8364 0C080114 */  jal       shim_guMtxCatF
/* 3B7EE8 E00B8368 00A0302D */   daddu    $a2, $a1, $zero
/* 3B7EEC E00B836C 27A40018 */  addiu     $a0, $sp, 0x18
/* 3B7EF0 E00B8370 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 3B7EF4 E00B8374 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 3B7EF8 E00B8378 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 3B7EFC E00B837C 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 3B7F00 E00B8380 96050000 */  lhu       $a1, 0x0($s0)
/* 3B7F04 E00B8384 8E220000 */  lw        $v0, 0x0($s1)
/* 3B7F08 E00B8388 00052980 */  sll       $a1, $a1, 6
/* 3B7F0C E00B838C 00B22821 */  addu      $a1, $a1, $s2
/* 3B7F10 E00B8390 0C080118 */  jal       shim_guMtxF2L
/* 3B7F14 E00B8394 00452821 */   addu     $a1, $v0, $a1
/* 3B7F18 E00B8398 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3B7F1C E00B839C 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3B7F20 E00B83A0 3C09DA38 */  lui       $t1, (0xDA380001 >> 16)
/* 3B7F24 E00B83A4 35290001 */  ori       $t1, $t1, (0xDA380001 & 0xFFFF)
/* 3B7F28 E00B83A8 27A40018 */  addiu     $a0, $sp, 0x18
/* 3B7F2C E00B83AC 4480B000 */  mtc1      $zero, $f22
/* 3B7F30 E00B83B0 8E880000 */  lw        $t0, 0x0($s4)
/* 3B7F34 E00B83B4 96020000 */  lhu       $v0, 0x0($s0)
/* 3B7F38 E00B83B8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3B7F3C E00B83BC 4481A000 */  mtc1      $at, $f20
/* 3B7F40 E00B83C0 0100282D */  daddu     $a1, $t0, $zero
/* 3B7F44 E00B83C4 25080008 */  addiu     $t0, $t0, 0x8
/* 3B7F48 E00B83C8 AE880000 */  sw        $t0, 0x0($s4)
/* 3B7F4C E00B83CC ACA30000 */  sw        $v1, 0x0($a1)
/* 3B7F50 E00B83D0 24430001 */  addiu     $v1, $v0, 0x1
/* 3B7F54 E00B83D4 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3B7F58 E00B83D8 00021180 */  sll       $v0, $v0, 6
/* 3B7F5C E00B83DC 4406B000 */  mfc1      $a2, $f22
/* 3B7F60 E00B83E0 00521021 */  addu      $v0, $v0, $s2
/* 3B7F64 E00B83E4 A6030000 */  sh        $v1, 0x0($s0)
/* 3B7F68 E00B83E8 8E230000 */  lw        $v1, 0x0($s1)
/* 3B7F6C E00B83EC 4407B000 */  mfc1      $a3, $f22
/* 3B7F70 E00B83F0 00621821 */  addu      $v1, $v1, $v0
/* 3B7F74 E00B83F4 25020008 */  addiu     $v0, $t0, 0x8
/* 3B7F78 E00B83F8 ACA30004 */  sw        $v1, 0x4($a1)
/* 3B7F7C E00B83FC AE820000 */  sw        $v0, 0x0($s4)
/* 3B7F80 E00B8400 AD090000 */  sw        $t1, 0x0($t0)
/* 3B7F84 E00B8404 8EE30204 */  lw        $v1, 0x204($s7)
/* 3B7F88 E00B8408 3C17DE00 */  lui       $s7, (0xDE000000 >> 16)
/* 3B7F8C E00B840C 3C020900 */  lui       $v0, %hi(D_09000280_4152E0)
/* 3B7F90 E00B8410 24420280 */  addiu     $v0, $v0, %lo(D_09000280_4152E0)
/* 3B7F94 E00B8414 AD170008 */  sw        $s7, 0x8($t0)
/* 3B7F98 E00B8418 AD02000C */  sw        $v0, 0xC($t0)
/* 3B7F9C E00B841C AD030004 */  sw        $v1, 0x4($t0)
/* 3B7FA0 E00B8420 E7B40010 */  swc1      $f20, 0x10($sp)
/* 3B7FA4 E00B8424 8E650038 */  lw        $a1, 0x38($s3)
/* 3B7FA8 E00B8428 25080010 */  addiu     $t0, $t0, 0x10
/* 3B7FAC E00B842C 0C080104 */  jal       shim_guRotateF
/* 3B7FB0 E00B8430 AE880000 */   sw       $t0, 0x0($s4)
/* 3B7FB4 E00B8434 8E65003C */  lw        $a1, 0x3C($s3)
/* 3B7FB8 E00B8438 8E660040 */  lw        $a2, 0x40($s3)
/* 3B7FBC E00B843C 4407A000 */  mfc1      $a3, $f20
/* 3B7FC0 E00B8440 0C080110 */  jal       shim_guScaleF
/* 3B7FC4 E00B8444 02A0202D */   daddu    $a0, $s5, $zero
/* 3B7FC8 E00B8448 02A0202D */  daddu     $a0, $s5, $zero
/* 3B7FCC E00B844C 27A50018 */  addiu     $a1, $sp, 0x18
/* 3B7FD0 E00B8450 0C080114 */  jal       shim_guMtxCatF
/* 3B7FD4 E00B8454 00A0302D */   daddu    $a2, $a1, $zero
/* 3B7FD8 E00B8458 27A40018 */  addiu     $a0, $sp, 0x18
/* 3B7FDC E00B845C 96050000 */  lhu       $a1, 0x0($s0)
/* 3B7FE0 E00B8460 8E220000 */  lw        $v0, 0x0($s1)
/* 3B7FE4 E00B8464 00052980 */  sll       $a1, $a1, 6
/* 3B7FE8 E00B8468 00B22821 */  addu      $a1, $a1, $s2
/* 3B7FEC E00B846C 0C080118 */  jal       shim_guMtxF2L
/* 3B7FF0 E00B8470 00452821 */   addu     $a1, $v0, $a1
/* 3B7FF4 E00B8474 8E850000 */  lw        $a1, 0x0($s4)
/* 3B7FF8 E00B8478 00A0202D */  daddu     $a0, $a1, $zero
/* 3B7FFC E00B847C 24A50008 */  addiu     $a1, $a1, 0x8
/* 3B8000 E00B8480 AE850000 */  sw        $a1, 0x0($s4)
/* 3B8004 E00B8484 96020000 */  lhu       $v0, 0x0($s0)
/* 3B8008 E00B8488 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3B800C E00B848C AC830000 */  sw        $v1, 0x0($a0)
/* 3B8010 E00B8490 24430001 */  addiu     $v1, $v0, 0x1
/* 3B8014 E00B8494 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3B8018 E00B8498 00021180 */  sll       $v0, $v0, 6
/* 3B801C E00B849C A6030000 */  sh        $v1, 0x0($s0)
/* 3B8020 E00B84A0 8E230000 */  lw        $v1, 0x0($s1)
/* 3B8024 E00B84A4 00521021 */  addu      $v0, $v0, $s2
/* 3B8028 E00B84A8 00621821 */  addu      $v1, $v1, $v0
/* 3B802C E00B84AC 24A20008 */  addiu     $v0, $a1, 0x8
/* 3B8030 E00B84B0 AC830004 */  sw        $v1, 0x4($a0)
/* 3B8034 E00B84B4 AE820000 */  sw        $v0, 0x0($s4)
/* 3B8038 E00B84B8 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 3B803C E00B84BC ACA20000 */  sw        $v0, 0x0($a1)
/* 3B8040 E00B84C0 9262002B */  lbu       $v0, 0x2B($s3)
/* 3B8044 E00B84C4 9264002F */  lbu       $a0, 0x2F($s3)
/* 3B8048 E00B84C8 92630033 */  lbu       $v1, 0x33($s3)
/* 3B804C E00B84CC 8FAA00A0 */  lw        $t2, 0xA0($sp)
/* 3B8050 E00B84D0 00021600 */  sll       $v0, $v0, 24
/* 3B8054 E00B84D4 00042400 */  sll       $a0, $a0, 16
/* 3B8058 E00B84D8 00441025 */  or        $v0, $v0, $a0
/* 3B805C E00B84DC 00031A00 */  sll       $v1, $v1, 8
/* 3B8060 E00B84E0 00431025 */  or        $v0, $v0, $v1
/* 3B8064 E00B84E4 314400FF */  andi      $a0, $t2, 0xFF
/* 3B8068 E00B84E8 00441025 */  or        $v0, $v0, $a0
/* 3B806C E00B84EC ACA20004 */  sw        $v0, 0x4($a1)
/* 3B8070 E00B84F0 8FAA009C */  lw        $t2, 0x9C($sp)
/* 3B8074 E00B84F4 25420001 */  addiu     $v0, $t2, 0x1
/* 3B8078 E00B84F8 8FAA0098 */  lw        $t2, 0x98($sp)
/* 3B807C E00B84FC 02C21023 */  subu      $v0, $s6, $v0
/* 3B8080 E00B8500 0142102A */  slt       $v0, $t2, $v0
/* 3B8084 E00B8504 14400018 */  bnez      $v0, .LE00B8568
/* 3B8088 E00B8508 00161042 */   srl      $v0, $s6, 1
/* 3B808C E00B850C 24A20010 */  addiu     $v0, $a1, 0x10
/* 3B8090 E00B8510 AE820000 */  sw        $v0, 0x0($s4)
/* 3B8094 E00B8514 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3B8098 E00B8518 ACA20008 */  sw        $v0, 0x8($a1)
/* 3B809C E00B851C 8FAA00A4 */  lw        $t2, 0xA4($sp)
/* 3B80A0 E00B8520 000A1E00 */  sll       $v1, $t2, 24
/* 3B80A4 E00B8524 8FAA00A8 */  lw        $t2, 0xA8($sp)
/* 3B80A8 E00B8528 314200FF */  andi      $v0, $t2, 0xFF
/* 3B80AC E00B852C 00021400 */  sll       $v0, $v0, 16
/* 3B80B0 E00B8530 8FAA00AC */  lw        $t2, 0xAC($sp)
/* 3B80B4 E00B8534 00621825 */  or        $v1, $v1, $v0
/* 3B80B8 E00B8538 314200FF */  andi      $v0, $t2, 0xFF
/* 3B80BC E00B853C 00021200 */  sll       $v0, $v0, 8
/* 3B80C0 E00B8540 00621825 */  or        $v1, $v1, $v0
/* 3B80C4 E00B8544 00641825 */  or        $v1, $v1, $a0
/* 3B80C8 E00B8548 24A20018 */  addiu     $v0, $a1, 0x18
/* 3B80CC E00B854C ACA3000C */  sw        $v1, 0xC($a1)
/* 3B80D0 E00B8550 AE820000 */  sw        $v0, 0x0($s4)
/* 3B80D4 E00B8554 3C020900 */  lui       $v0, %hi(D_09000348_4153A8)
/* 3B80D8 E00B8558 24420348 */  addiu     $v0, $v0, %lo(D_09000348_4153A8)
/* 3B80DC E00B855C ACB70010 */  sw        $s7, 0x10($a1)
/* 3B80E0 E00B8560 ACA20014 */  sw        $v0, 0x14($a1)
/* 3B80E4 E00B8564 00161042 */  srl       $v0, $s6, 1
.LE00B8568:
/* 3B80E8 E00B8568 184000BF */  blez      $v0, .LE00B8868
/* 3B80EC E00B856C 0000B82D */   daddu    $s7, $zero, $zero
/* 3B80F0 E00B8570 001E1080 */  sll       $v0, $fp, 2
/* 3B80F4 E00B8574 4600B506 */  mov.s     $f20, $f22
/* 3B80F8 E00B8578 3C01E00C */  lui       $at, (0xE00C0000 >> 16)
/* 3B80FC E00B857C D4368CD0 */  ldc1      $f22, -0x7330($at)
/* 3B8100 E00B8580 005E1021 */  addu      $v0, $v0, $fp
/* 3B8104 E00B8584 AFA200BC */  sw        $v0, 0xBC($sp)
/* 3B8108 E00B8588 AFBE00C4 */  sw        $fp, 0xC4($sp)
.LE00B858C:
/* 3B810C E00B858C 8FAA00B0 */  lw        $t2, 0xB0($sp)
/* 3B8110 E00B8590 114000AE */  beqz      $t2, .LE00B884C
/* 3B8114 E00B8594 0000902D */   daddu    $s2, $zero, $zero
/* 3B8118 E00B8598 3C1E0001 */  lui       $fp, (0x11630 >> 16)
/* 3B811C E00B859C 37DE1630 */  ori       $fp, $fp, (0x11630 & 0xFFFF)
/* 3B8120 E00B85A0 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 3B8124 E00B85A4 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 3B8128 E00B85A8 8FAA00C4 */  lw        $t2, 0xC4($sp)
/* 3B812C E00B85AC 0240982D */  daddu     $s3, $s2, $zero
/* 3B8130 E00B85B0 AFAA00B8 */  sw        $t2, 0xB8($sp)
/* 3B8134 E00B85B4 8FAA00A4 */  lw        $t2, 0xA4($sp)
/* 3B8138 E00B85B8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3B813C E00B85BC 4481C000 */  mtc1      $at, $f24
/* 3B8140 E00B85C0 000A5600 */  sll       $t2, $t2, 24
/* 3B8144 E00B85C4 AFAA00C0 */  sw        $t2, 0xC0($sp)
.LE00B85C8:
/* 3B8148 E00B85C8 8FAA00B8 */  lw        $t2, 0xB8($sp)
/* 3B814C E00B85CC 16C00002 */  bnez      $s6, .LE00B85D8
/* 3B8150 E00B85D0 0156001A */   div      $zero, $t2, $s6
/* 3B8154 E00B85D4 0007000D */  break     7
.LE00B85D8:
/* 3B8158 E00B85D8 2401FFFF */  addiu     $at, $zero, -0x1
/* 3B815C E00B85DC 16C10004 */  bne       $s6, $at, .LE00B85F0
/* 3B8160 E00B85E0 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 3B8164 E00B85E4 15410002 */  bne       $t2, $at, .LE00B85F0
/* 3B8168 E00B85E8 00000000 */   nop
/* 3B816C E00B85EC 0006000D */  break     6
.LE00B85F0:
/* 3B8170 E00B85F0 00001810 */  mfhi      $v1
/* 3B8174 E00B85F4 00131080 */  sll       $v0, $s3, 2
/* 3B8178 E00B85F8 00531021 */  addu      $v0, $v0, $s3
/* 3B817C E00B85FC 8FAA00B4 */  lw        $t2, 0xB4($sp)
/* 3B8180 E00B8600 00021040 */  sll       $v0, $v0, 1
/* 3B8184 E00B8604 01422821 */  addu      $a1, $t2, $v0
/* 3B8188 E00B8608 8FAA00BC */  lw        $t2, 0xBC($sp)
/* 3B818C E00B860C 0143102A */  slt       $v0, $t2, $v1
/* 3B8190 E00B8610 14400089 */  bnez      $v0, .LE00B8838
/* 3B8194 E00B8614 24620001 */   addiu    $v0, $v1, 0x1
/* 3B8198 E00B8618 8FAA0098 */  lw        $t2, 0x98($sp)
/* 3B819C E00B861C 02C21023 */  subu      $v0, $s6, $v0
/* 3B81A0 E00B8620 0142102A */  slt       $v0, $t2, $v0
/* 3B81A4 E00B8624 14400084 */  bnez      $v0, .LE00B8838
/* 3B81A8 E00B8628 00038080 */   sll      $s0, $v1, 2
/* 3B81AC E00B862C 02038021 */  addu      $s0, $s0, $v1
/* 3B81B0 E00B8630 00108040 */  sll       $s0, $s0, 1
/* 3B81B4 E00B8634 02058821 */  addu      $s1, $s0, $a1
/* 3B81B8 E00B8638 82220001 */  lb        $v0, 0x1($s1)
/* 3B81BC E00B863C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 3B81C0 E00B8640 44811000 */  mtc1      $at, $f2
/* 3B81C4 E00B8644 4407A000 */  mfc1      $a3, $f20
/* 3B81C8 E00B8648 44820000 */  mtc1      $v0, $f0
/* 3B81CC E00B864C 00000000 */  nop
/* 3B81D0 E00B8650 46800020 */  cvt.s.w   $f0, $f0
/* 3B81D4 E00B8654 82220000 */  lb        $v0, 0x0($s1)
/* 3B81D8 E00B8658 46020000 */  add.s     $f0, $f0, $f2
/* 3B81DC E00B865C 44822000 */  mtc1      $v0, $f4
/* 3B81E0 E00B8660 00000000 */  nop
/* 3B81E4 E00B8664 46802120 */  cvt.s.w   $f4, $f4
/* 3B81E8 E00B8668 44052000 */  mfc1      $a1, $f4
/* 3B81EC E00B866C 44060000 */  mfc1      $a2, $f0
/* 3B81F0 E00B8670 0C080108 */  jal       shim_guTranslateF
/* 3B81F4 E00B8674 27A40018 */   addiu    $a0, $sp, 0x18
/* 3B81F8 E00B8678 8FAA00B4 */  lw        $t2, 0xB4($sp)
/* 3B81FC E00B867C 020A8021 */  addu      $s0, $s0, $t2
/* 3B8200 E00B8680 86020002 */  lh        $v0, 0x2($s0)
/* 3B8204 E00B8684 44821000 */  mtc1      $v0, $f2
/* 3B8208 E00B8688 00000000 */  nop
/* 3B820C E00B868C 468010A0 */  cvt.s.w   $f2, $f2
/* 3B8210 E00B8690 460010A1 */  cvt.d.s   $f2, $f2
/* 3B8214 E00B8694 46361082 */  mul.d     $f2, $f2, $f22
/* 3B8218 E00B8698 00000000 */  nop
/* 3B821C E00B869C 86020004 */  lh        $v0, 0x4($s0)
/* 3B8220 E00B86A0 44820000 */  mtc1      $v0, $f0
/* 3B8224 E00B86A4 00000000 */  nop
/* 3B8228 E00B86A8 46800020 */  cvt.s.w   $f0, $f0
/* 3B822C E00B86AC 46000021 */  cvt.d.s   $f0, $f0
/* 3B8230 E00B86B0 46360002 */  mul.d     $f0, $f0, $f22
/* 3B8234 E00B86B4 00000000 */  nop
/* 3B8238 E00B86B8 4407C000 */  mfc1      $a3, $f24
/* 3B823C E00B86BC 462010A0 */  cvt.s.d   $f2, $f2
/* 3B8240 E00B86C0 44051000 */  mfc1      $a1, $f2
/* 3B8244 E00B86C4 46200020 */  cvt.s.d   $f0, $f0
/* 3B8248 E00B86C8 44060000 */  mfc1      $a2, $f0
/* 3B824C E00B86CC 0C080110 */  jal       shim_guScaleF
/* 3B8250 E00B86D0 02A0202D */   daddu    $a0, $s5, $zero
/* 3B8254 E00B86D4 02A0202D */  daddu     $a0, $s5, $zero
/* 3B8258 E00B86D8 27A50018 */  addiu     $a1, $sp, 0x18
/* 3B825C E00B86DC 0C080114 */  jal       shim_guMtxCatF
/* 3B8260 E00B86E0 00A0302D */   daddu    $a2, $a1, $zero
/* 3B8264 E00B86E4 86220006 */  lh        $v0, 0x6($s1)
/* 3B8268 E00B86E8 3C0AE00C */  lui       $t2, %hi(D_E00B8CA4)
/* 3B826C E00B86EC 254A8CA4 */  addiu     $t2, $t2, %lo(D_E00B8CA4)
/* 3B8270 E00B86F0 44821000 */  mtc1      $v0, $f2
/* 3B8274 E00B86F4 00000000 */  nop
/* 3B8278 E00B86F8 468010A0 */  cvt.s.w   $f2, $f2
/* 3B827C E00B86FC 02571021 */  addu      $v0, $s2, $s7
/* 3B8280 E00B8700 30420007 */  andi      $v0, $v0, 0x7
/* 3B8284 E00B8704 00021080 */  sll       $v0, $v0, 2
/* 3B8288 E00B8708 004A1021 */  addu      $v0, $v0, $t2
/* 3B828C E00B870C C4400000 */  lwc1      $f0, 0x0($v0)
/* 3B8290 E00B8710 46800020 */  cvt.s.w   $f0, $f0
/* 3B8294 E00B8714 46001080 */  add.s     $f2, $f2, $f0
/* 3B8298 E00B8718 4406A000 */  mfc1      $a2, $f20
/* 3B829C E00B871C 4407A000 */  mfc1      $a3, $f20
/* 3B82A0 E00B8720 44051000 */  mfc1      $a1, $f2
/* 3B82A4 E00B8724 02A0202D */  daddu     $a0, $s5, $zero
/* 3B82A8 E00B8728 0C080104 */  jal       shim_guRotateF
/* 3B82AC E00B872C E7B80010 */   swc1     $f24, 0x10($sp)
/* 3B82B0 E00B8730 02A0202D */  daddu     $a0, $s5, $zero
/* 3B82B4 E00B8734 27A50018 */  addiu     $a1, $sp, 0x18
/* 3B82B8 E00B8738 0C080114 */  jal       shim_guMtxCatF
/* 3B82BC E00B873C 00A0302D */   daddu    $a2, $a1, $zero
/* 3B82C0 E00B8740 27A40018 */  addiu     $a0, $sp, 0x18
/* 3B82C4 E00B8744 3C058007 */  lui       $a1, %hi(gMatrixListPos)
/* 3B82C8 E00B8748 94A541F0 */  lhu       $a1, %lo(gMatrixListPos)($a1)
/* 3B82CC E00B874C 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3B82D0 E00B8750 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 3B82D4 E00B8754 00052980 */  sll       $a1, $a1, 6
/* 3B82D8 E00B8758 00BE2821 */  addu      $a1, $a1, $fp
/* 3B82DC E00B875C 0C080118 */  jal       shim_guMtxF2L
/* 3B82E0 E00B8760 00452821 */   addu     $a1, $v0, $a1
/* 3B82E4 E00B8764 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 3B82E8 E00B8768 8E840000 */  lw        $a0, 0x0($s4)
/* 3B82EC E00B876C 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3B82F0 E00B8770 0080282D */  daddu     $a1, $a0, $zero
/* 3B82F4 E00B8774 24840008 */  addiu     $a0, $a0, 0x8
/* 3B82F8 E00B8778 AE840000 */  sw        $a0, 0x0($s4)
/* 3B82FC E00B877C 3C028007 */  lui       $v0, %hi(gMatrixListPos)
/* 3B8300 E00B8780 944241F0 */  lhu       $v0, %lo(gMatrixListPos)($v0)
/* 3B8304 E00B8784 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3B8308 E00B8788 ACA30000 */  sw        $v1, 0x0($a1)
/* 3B830C E00B878C 24430001 */  addiu     $v1, $v0, 0x1
/* 3B8310 E00B8790 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3B8314 E00B8794 00021180 */  sll       $v0, $v0, 6
/* 3B8318 E00B8798 3C018007 */  lui       $at, %hi(gMatrixListPos)
/* 3B831C E00B879C A42341F0 */  sh        $v1, %lo(gMatrixListPos)($at)
/* 3B8320 E00B87A0 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 3B8324 E00B87A4 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 3B8328 E00B87A8 005E1021 */  addu      $v0, $v0, $fp
/* 3B832C E00B87AC 00621821 */  addu      $v1, $v1, $v0
/* 3B8330 E00B87B0 24820008 */  addiu     $v0, $a0, 0x8
/* 3B8334 E00B87B4 ACA30004 */  sw        $v1, 0x4($a1)
/* 3B8338 E00B87B8 AE820000 */  sw        $v0, 0x0($s4)
/* 3B833C E00B87BC 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3B8340 E00B87C0 AC820000 */  sw        $v0, 0x0($a0)
/* 3B8344 E00B87C4 92050008 */  lbu       $a1, 0x8($s0)
/* 3B8348 E00B87C8 24820010 */  addiu     $v0, $a0, 0x10
/* 3B834C E00B87CC AE820000 */  sw        $v0, 0x0($s4)
/* 3B8350 E00B87D0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3B8354 E00B87D4 AC820008 */  sw        $v0, 0x8($a0)
/* 3B8358 E00B87D8 3C020900 */  lui       $v0, %hi(D_09000328_415388)
/* 3B835C E00B87DC 24420328 */  addiu     $v0, $v0, %lo(D_09000328_415388)
/* 3B8360 E00B87E0 AC82000C */  sw        $v0, 0xC($a0)
/* 3B8364 E00B87E4 24820018 */  addiu     $v0, $a0, 0x18
/* 3B8368 E00B87E8 AE820000 */  sw        $v0, 0x0($s4)
/* 3B836C E00B87EC 24020040 */  addiu     $v0, $zero, 0x40
/* 3B8370 E00B87F0 AC860010 */  sw        $a2, 0x10($a0)
/* 3B8374 E00B87F4 AC820014 */  sw        $v0, 0x14($a0)
/* 3B8378 E00B87F8 8FAA00A8 */  lw        $t2, 0xA8($sp)
/* 3B837C E00B87FC 314300FF */  andi      $v1, $t2, 0xFF
/* 3B8380 E00B8800 8FAA00A0 */  lw        $t2, 0xA0($sp)
/* 3B8384 E00B8804 01450018 */  mult      $t2, $a1
/* 3B8388 E00B8808 8FAA00C0 */  lw        $t2, 0xC0($sp)
/* 3B838C E00B880C 00031C00 */  sll       $v1, $v1, 16
/* 3B8390 E00B8810 01431825 */  or        $v1, $t2, $v1
/* 3B8394 E00B8814 8FAA00AC */  lw        $t2, 0xAC($sp)
/* 3B8398 E00B8818 314200FF */  andi      $v0, $t2, 0xFF
/* 3B839C E00B881C 00021200 */  sll       $v0, $v0, 8
/* 3B83A0 E00B8820 00621825 */  or        $v1, $v1, $v0
/* 3B83A4 E00B8824 00005012 */  mflo      $t2
/* 3B83A8 E00B8828 000A1203 */  sra       $v0, $t2, 8
/* 3B83AC E00B882C 304200FF */  andi      $v0, $v0, 0xFF
/* 3B83B0 E00B8830 00621825 */  or        $v1, $v1, $v0
/* 3B83B4 E00B8834 AC830004 */  sw        $v1, 0x4($a0)
.LE00B8838:
/* 3B83B8 E00B8838 8FAA00B0 */  lw        $t2, 0xB0($sp)
/* 3B83BC E00B883C 26520001 */  addiu     $s2, $s2, 0x1
/* 3B83C0 E00B8840 024A102A */  slt       $v0, $s2, $t2
/* 3B83C4 E00B8844 1440FF60 */  bnez      $v0, .LE00B85C8
/* 3B83C8 E00B8848 02769821 */   addu     $s3, $s3, $s6
.LE00B884C:
/* 3B83CC E00B884C 26F70001 */  addiu     $s7, $s7, 0x1
/* 3B83D0 E00B8850 00161042 */  srl       $v0, $s6, 1
/* 3B83D4 E00B8854 8FAA00C4 */  lw        $t2, 0xC4($sp)
/* 3B83D8 E00B8858 02E2102A */  slt       $v0, $s7, $v0
/* 3B83DC E00B885C 254A0002 */  addiu     $t2, $t2, 0x2
/* 3B83E0 E00B8860 1440FF4A */  bnez      $v0, .LE00B858C
/* 3B83E4 E00B8864 AFAA00C4 */   sw       $t2, 0xC4($sp)
.LE00B8868:
/* 3B83E8 E00B8868 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 3B83EC E00B886C 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 3B83F0 E00B8870 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 3B83F4 E00B8874 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3B83F8 E00B8878 8C820000 */  lw        $v0, 0x0($a0)
/* 3B83FC E00B887C 24050040 */  addiu     $a1, $zero, 0x40
/* 3B8400 E00B8880 0040182D */  daddu     $v1, $v0, $zero
/* 3B8404 E00B8884 24420008 */  addiu     $v0, $v0, 0x8
/* 3B8408 E00B8888 AC820000 */  sw        $v0, 0x0($a0)
/* 3B840C E00B888C AC660000 */  sw        $a2, 0x0($v1)
/* 3B8410 E00B8890 AC650004 */  sw        $a1, 0x4($v1)
/* 3B8414 E00B8894 24430008 */  addiu     $v1, $v0, 0x8
/* 3B8418 E00B8898 AC830000 */  sw        $v1, 0x0($a0)
/* 3B841C E00B889C 24430010 */  addiu     $v1, $v0, 0x10
/* 3B8420 E00B88A0 AC460000 */  sw        $a2, 0x0($v0)
/* 3B8424 E00B88A4 AC450004 */  sw        $a1, 0x4($v0)
/* 3B8428 E00B88A8 AC830000 */  sw        $v1, 0x0($a0)
/* 3B842C E00B88AC 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* 3B8430 E00B88B0 AC430008 */  sw        $v1, 0x8($v0)
/* 3B8434 E00B88B4 AC40000C */  sw        $zero, 0xC($v0)
/* 3B8438 E00B88B8 8FBF00EC */  lw        $ra, 0xEC($sp)
/* 3B843C E00B88BC 8FBE00E8 */  lw        $fp, 0xE8($sp)
/* 3B8440 E00B88C0 8FB700E4 */  lw        $s7, 0xE4($sp)
/* 3B8444 E00B88C4 8FB600E0 */  lw        $s6, 0xE0($sp)
/* 3B8448 E00B88C8 8FB500DC */  lw        $s5, 0xDC($sp)
/* 3B844C E00B88CC 8FB400D8 */  lw        $s4, 0xD8($sp)
/* 3B8450 E00B88D0 8FB300D4 */  lw        $s3, 0xD4($sp)
/* 3B8454 E00B88D4 8FB200D0 */  lw        $s2, 0xD0($sp)
/* 3B8458 E00B88D8 8FB100CC */  lw        $s1, 0xCC($sp)
/* 3B845C E00B88DC 8FB000C8 */  lw        $s0, 0xC8($sp)
/* 3B8460 E00B88E0 D7B80100 */  ldc1      $f24, 0x100($sp)
/* 3B8464 E00B88E4 D7B600F8 */  ldc1      $f22, 0xF8($sp)
/* 3B8468 E00B88E8 D7B400F0 */  ldc1      $f20, 0xF0($sp)
/* 3B846C E00B88EC 03E00008 */  jr        $ra

### DECOMPILED C INSTRUCTIONS:

void water_fountain_appendGfx(void *effect) {
    WaterFountainFXData* data = ((EffectInstance*)effect)->data.waterFountain;
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 lifeTime = data->lifeTime;
    s32 timeLeft = data->timeLeft;
    s32 sp9C;
    s32 unk_24 = data->unk_24;
    s32 unk_00 = data->unk_00;
    s32 unk_18 = data->unk_18;
    s32 unk_1C = data->unk_1C;
    s32 unk_20 = data->unk_20;
    s32 spB0;
    s32 var_s6;
    s32 temp;
    UnkStruct* basePtr;
    Matrix4f sp18;
    Matrix4f sp58;
    s32 i;
    s32 j;

    if (unk_00 == 0) {
        spB0 = 3;
        basePtr = D_E00B8900;
        var_s6 = 20;
    } else {
        var_s6 = 11;
        spB0 = 3;
        basePtr = D_E00B8B58;
    }

    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->unk_34, data->unk_34, data->unk_34);
    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);
    gSPDisplayList(gMainGfxPos++, D_09000280_3B8AE0);

    shim_guRotateF(sp18, data->unk_38, 0.0f, 0.0f, 1.0f);
    shim_guScaleF(sp58, data->unk_3C, data->unk_40, 1.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetEnvColor(gMainGfxPos++, data->unk_28, data->unk_2C, data->unk_30, unk_24);

    temp = sp9C + 1;
    if (timeLeft >= var_s6 - temp) {
        gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_18, unk_1C, unk_20, unk_24);
        gSPDisplayList(gMainGfxPos++, D_09000348_3B8BA8);
    }

    for (i = 0; i < var_s6 / 2; i++) {
        for (j = 0; j < spB0; j++) {
            s32 idx = (lifeTime + i * 2) % var_s6;
            UnkStruct* ptr = &basePtr[j * var_s6];

            if (lifeTime * 5 >= idx) {
                s32 temp2 = idx + 1;
                if (timeLeft >= var_s6 - temp2) {
                    shim_guTranslateF(sp18, (f32) ptr[idx].unk_00, (f32) ptr[idx].unk_01 + 10.0f, 0.0f);
                    shim_guScaleF(sp58, (f32) basePtr[idx].unk_02 * 0.01, (f32) basePtr[idx].unk_04 * 0.01, 1.0f);
                    shim_guMtxCatF(sp58, sp18, sp18);
                    shim_guRotateF(sp58, (f32) ptr[idx].unk_06 + D_E00B8CA4[(j + i) & 7], 0.0f, 0.0f, 1.0f);
                    shim_guMtxCatF(sp58, sp18, sp18);
                    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

                    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
                    gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_18, unk_1C, unk_20, (unk_24 * basePtr[idx].unk_08) >> 8);
                    gSPDisplayList(gMainGfxPos++, D_09000328_3B8B88);
                    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
                }
            }
        }
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel misc_particles_update
/* 3DE290 E00E4290 27BDFF80 */  addiu     $sp, $sp, -0x80
/* 3DE294 E00E4294 AFB40038 */  sw        $s4, 0x38($sp)
/* 3DE298 E00E4298 0080A02D */  daddu     $s4, $a0, $zero
/* 3DE29C E00E429C AFBF004C */  sw        $ra, 0x4C($sp)
/* 3DE2A0 E00E42A0 AFBE0048 */  sw        $fp, 0x48($sp)
/* 3DE2A4 E00E42A4 AFB70044 */  sw        $s7, 0x44($sp)
/* 3DE2A8 E00E42A8 AFB60040 */  sw        $s6, 0x40($sp)
/* 3DE2AC E00E42AC AFB5003C */  sw        $s5, 0x3C($sp)
/* 3DE2B0 E00E42B0 AFB30034 */  sw        $s3, 0x34($sp)
/* 3DE2B4 E00E42B4 AFB20030 */  sw        $s2, 0x30($sp)
/* 3DE2B8 E00E42B8 AFB1002C */  sw        $s1, 0x2C($sp)
/* 3DE2BC E00E42BC AFB00028 */  sw        $s0, 0x28($sp)
/* 3DE2C0 E00E42C0 F7BE0078 */  sdc1      $f30, 0x78($sp)
/* 3DE2C4 E00E42C4 F7BC0070 */  sdc1      $f28, 0x70($sp)
/* 3DE2C8 E00E42C8 F7BA0068 */  sdc1      $f26, 0x68($sp)
/* 3DE2CC E00E42CC F7B80060 */  sdc1      $f24, 0x60($sp)
/* 3DE2D0 E00E42D0 F7B60058 */  sdc1      $f22, 0x58($sp)
/* 3DE2D4 E00E42D4 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 3DE2D8 E00E42D8 8E830000 */  lw        $v1, 0x0($s4)
/* 3DE2DC E00E42DC 8E91000C */  lw        $s1, 0xC($s4)
/* 3DE2E0 E00E42E0 30620010 */  andi      $v0, $v1, 0x10
/* 3DE2E4 E00E42E4 8E320000 */  lw        $s2, 0x0($s1)
/* 3DE2E8 E00E42E8 10400005 */  beqz      $v0, .LE00E4300
/* 3DE2EC E00E42EC 2402FFEF */   addiu    $v0, $zero, -0x11
/* 3DE2F0 E00E42F0 00621024 */  and       $v0, $v1, $v0
/* 3DE2F4 E00E42F4 AE820000 */  sw        $v0, 0x0($s4)
/* 3DE2F8 E00E42F8 24020010 */  addiu     $v0, $zero, 0x10
/* 3DE2FC E00E42FC AE220030 */  sw        $v0, 0x30($s1)
.LE00E4300:
/* 3DE300 E00E4300 8E230030 */  lw        $v1, 0x30($s1)
/* 3DE304 E00E4304 286203E8 */  slti      $v0, $v1, 0x3E8
/* 3DE308 E00E4308 10400002 */  beqz      $v0, .LE00E4314
/* 3DE30C E00E430C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 3DE310 E00E4310 AE220030 */  sw        $v0, 0x30($s1)
.LE00E4314:
/* 3DE314 E00E4314 8E220034 */  lw        $v0, 0x34($s1)
/* 3DE318 E00E4318 8E230030 */  lw        $v1, 0x30($s1)
/* 3DE31C E00E431C 24420001 */  addiu     $v0, $v0, 0x1
/* 3DE320 E00E4320 04610005 */  bgez      $v1, .LE00E4338
/* 3DE324 E00E4324 AE220034 */   sw       $v0, 0x34($s1)
/* 3DE328 E00E4328 0C080128 */  jal       shim_remove_effect
/* 3DE32C E00E432C 0280202D */   daddu    $a0, $s4, $zero
/* 3DE330 E00E4330 08039231 */  j         .LE00E48C4
/* 3DE334 E00E4334 00000000 */   nop
.LE00E4338:
/* 3DE338 E00E4338 0060A82D */  daddu     $s5, $v1, $zero
/* 3DE33C E00E433C 2AA20008 */  slti      $v0, $s5, 0x8
/* 3DE340 E00E4340 10400002 */  beqz      $v0, .LE00E434C
/* 3DE344 E00E4344 00151140 */   sll      $v0, $s5, 5
/* 3DE348 E00E4348 AE220044 */  sw        $v0, 0x44($s1)
.LE00E434C:
/* 3DE34C E00E434C 3C108007 */  lui       $s0, %hi(gCurrentCameraID)
/* 3DE350 E00E4350 26107410 */  addiu     $s0, $s0, %lo(gCurrentCameraID)
/* 3DE354 E00E4354 8E030000 */  lw        $v1, 0x0($s0)
/* 3DE358 E00E4358 C6300014 */  lwc1      $f16, 0x14($s1)
/* 3DE35C E00E435C C63E0010 */  lwc1      $f30, 0x10($s1)
/* 3DE360 E00E4360 00031080 */  sll       $v0, $v1, 2
/* 3DE364 E00E4364 00431021 */  addu      $v0, $v0, $v1
/* 3DE368 E00E4368 00021080 */  sll       $v0, $v0, 2
/* 3DE36C E00E436C 00431023 */  subu      $v0, $v0, $v1
/* 3DE370 E00E4370 000218C0 */  sll       $v1, $v0, 3
/* 3DE374 E00E4374 00431021 */  addu      $v0, $v0, $v1
/* 3DE378 E00E4378 000210C0 */  sll       $v0, $v0, 3
/* 3DE37C E00E437C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3DE380 E00E4380 00220821 */  addu      $at, $at, $v0
/* 3DE384 E00E4384 C42C1DEC */  lwc1      $f12, %lo(gCameras + 0x6C)($at)
/* 3DE388 E00E4388 E7B00010 */  swc1      $f16, 0x10($sp)
/* 3DE38C E00E438C C6300004 */  lwc1      $f16, 0x4($s1)
/* 3DE390 E00E4390 E7B00014 */  swc1      $f16, 0x14($sp)
/* 3DE394 E00E4394 C6300008 */  lwc1      $f16, 0x8($s1)
/* 3DE398 E00E4398 E7B00018 */  swc1      $f16, 0x18($sp)
/* 3DE39C E00E439C C630000C */  lwc1      $f16, 0xC($s1)
/* 3DE3A0 E00E43A0 0C080144 */  jal       shim_cos_deg
/* 3DE3A4 E00E43A4 E7B0001C */   swc1     $f16, 0x1C($sp)
/* 3DE3A8 E00E43A8 8E030000 */  lw        $v1, 0x0($s0)
/* 3DE3AC E00E43AC 00031080 */  sll       $v0, $v1, 2
/* 3DE3B0 E00E43B0 00431021 */  addu      $v0, $v0, $v1
/* 3DE3B4 E00E43B4 00021080 */  sll       $v0, $v0, 2
/* 3DE3B8 E00E43B8 00431023 */  subu      $v0, $v0, $v1
/* 3DE3BC E00E43BC 000218C0 */  sll       $v1, $v0, 3
/* 3DE3C0 E00E43C0 00431021 */  addu      $v0, $v0, $v1
/* 3DE3C4 E00E43C4 000210C0 */  sll       $v0, $v0, 3
/* 3DE3C8 E00E43C8 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3DE3CC E00E43CC 00220821 */  addu      $at, $at, $v0
/* 3DE3D0 E00E43D0 C42C1DEC */  lwc1      $f12, %lo(gCameras + 0x6C)($at)
/* 3DE3D4 E00E43D4 0C080140 */  jal       shim_sin_deg
/* 3DE3D8 E00E43D8 46000706 */   mov.s    $f28, $f0
/* 3DE3DC E00E43DC 8E250038 */  lw        $a1, 0x38($s1)
/* 3DE3E0 E00E43E0 24130001 */  addiu     $s3, $zero, 0x1
/* 3DE3E4 E00E43E4 AFA50020 */  sw        $a1, 0x20($sp)
/* 3DE3E8 E00E43E8 8E3E003C */  lw        $fp, 0x3C($s1)
/* 3DE3EC E00E43EC 8E250040 */  lw        $a1, 0x40($s1)
/* 3DE3F0 E00E43F0 46000686 */  mov.s     $f26, $f0
/* 3DE3F4 E00E43F4 AFA50024 */  sw        $a1, 0x24($sp)
/* 3DE3F8 E00E43F8 8E820008 */  lw        $v0, 0x8($s4)
/* 3DE3FC E00E43FC 0262102A */  slt       $v0, $s3, $v0
/* 3DE400 E00E4400 10400130 */  beqz      $v0, .LE00E48C4
/* 3DE404 E00E4404 26310064 */   addiu    $s1, $s1, 0x64
/* 3DE408 E00E4408 241600FF */  addiu     $s6, $zero, 0xFF
/* 3DE40C E00E440C 3C17E00E */  lui       $s7, %hi(D_E00E4DC0)
/* 3DE410 E00E4410 26F74DC0 */  addiu     $s7, $s7, %lo(D_E00E4DC0)
/* 3DE414 E00E4414 26300058 */  addiu     $s0, $s1, 0x58
/* 3DE418 E00E4418 3C01E00E */  lui       $at, (0xE00E4E20 >> 16)
/* 3DE41C E00E441C D4384E20 */  ldc1      $f24, (0xE00E4E20 & 0xFFFF)($at)
/* 3DE420 E00E4420 3C01E00E */  lui       $at, (0xE00E4E28 >> 16)
/* 3DE424 E00E4424 D4364E28 */  ldc1      $f22, (0xE00E4E28 & 0xFFFF)($at)
.LE00E4428:
/* 3DE428 E00E4428 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE42C E00E442C 24420001 */  addiu     $v0, $v0, 0x1
/* 3DE430 E00E4430 AE02FFD4 */  sw        $v0, -0x2C($s0)
/* 3DE434 E00E4434 2842001E */  slti      $v0, $v0, 0x1E
/* 3DE438 E00E4438 14400006 */  bnez      $v0, .LE00E4454
/* 3DE43C E00E443C 2AA2001E */   slti     $v0, $s5, 0x1E
/* 3DE440 E00E4440 10400003 */  beqz      $v0, .LE00E4450
/* 3DE444 E00E4444 24020014 */   addiu    $v0, $zero, 0x14
/* 3DE448 E00E4448 08039115 */  j         .LE00E4454
/* 3DE44C E00E444C AE02FFD4 */   sw       $v0, -0x2C($s0)
.LE00E4450:
/* 3DE450 E00E4450 AE00FFD4 */  sw        $zero, -0x2C($s0)
.LE00E4454:
/* 3DE454 E00E4454 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE458 E00E4458 04420116 */  bltzl     $v0, .LE00E48B4
/* 3DE45C E00E445C 26730001 */   addiu    $s3, $s3, 0x1
/* 3DE460 E00E4460 1440002B */  bnez      $v0, .LE00E4510
/* 3DE464 E00E4464 00000000 */   nop
/* 3DE468 E00E4468 4600F40D */  trunc.w.s $f16, $f30
/* 3DE46C E00E446C 44048000 */  mfc1      $a0, $f16
/* 3DE470 E00E4470 0C080138 */  jal       shim_rand_int
/* 3DE474 E00E4474 00000000 */   nop
/* 3DE478 E00E4478 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3DE47C E00E447C 44811800 */  mtc1      $at, $f3
/* 3DE480 E00E4480 44801000 */  mtc1      $zero, $f2
/* 3DE484 E00E4484 4600F021 */  cvt.d.s   $f0, $f30
/* 3DE488 E00E4488 46220002 */  mul.d     $f0, $f0, $f2
/* 3DE48C E00E448C 00000000 */  nop
/* 3DE490 E00E4490 4482A000 */  mtc1      $v0, $f20
/* 3DE494 E00E4494 00000000 */  nop
/* 3DE498 E00E4498 4680A521 */  cvt.d.w   $f20, $f20
/* 3DE49C E00E449C 4620A501 */  sub.d     $f20, $f20, $f0
/* 3DE4A0 E00E44A0 4620A520 */  cvt.s.d   $f20, $f20
/* 3DE4A4 E00E44A4 461CA002 */  mul.s     $f0, $f20, $f28
/* 3DE4A8 E00E44A8 00000000 */  nop
/* 3DE4AC E00E44AC C7B00014 */  lwc1      $f16, 0x14($sp)
/* 3DE4B0 E00E44B0 46008000 */  add.s     $f0, $f16, $f0
/* 3DE4B4 E00E44B4 C7B00010 */  lwc1      $f16, 0x10($sp)
/* 3DE4B8 E00E44B8 461A0001 */  sub.s     $f0, $f0, $f26
/* 3DE4BC E00E44BC 4600840D */  trunc.w.s $f16, $f16
/* 3DE4C0 E00E44C0 44048000 */  mfc1      $a0, $f16
/* 3DE4C4 E00E44C4 0C080138 */  jal       shim_rand_int
/* 3DE4C8 E00E44C8 E600FFAC */   swc1     $f0, -0x54($s0)
/* 3DE4CC E00E44CC 461AA502 */  mul.s     $f20, $f20, $f26
/* 3DE4D0 E00E44D0 00000000 */  nop
/* 3DE4D4 E00E44D4 44820000 */  mtc1      $v0, $f0
/* 3DE4D8 E00E44D8 00000000 */  nop
/* 3DE4DC E00E44DC 46800020 */  cvt.s.w   $f0, $f0
/* 3DE4E0 E00E44E0 C7B00018 */  lwc1      $f16, 0x18($sp)
/* 3DE4E4 E00E44E4 8FA50020 */  lw        $a1, 0x20($sp)
/* 3DE4E8 E00E44E8 46008000 */  add.s     $f0, $f16, $f0
/* 3DE4EC E00E44EC C7B0001C */  lwc1      $f16, 0x1C($sp)
/* 3DE4F0 E00E44F0 AE05FFE0 */  sw        $a1, -0x20($s0)
/* 3DE4F4 E00E44F4 46148500 */  add.s     $f20, $f16, $f20
/* 3DE4F8 E00E44F8 AE1EFFE4 */  sw        $fp, -0x1C($s0)
/* 3DE4FC E00E44FC 8FA50024 */  lw        $a1, 0x24($sp)
/* 3DE500 E00E4500 461CA500 */  add.s     $f20, $f20, $f28
/* 3DE504 E00E4504 AE05FFE8 */  sw        $a1, -0x18($s0)
/* 3DE508 E00E4508 E600FFB0 */  swc1      $f0, -0x50($s0)
/* 3DE50C E00E450C E614FFB4 */  swc1      $f20, -0x4C($s0)
.LE00E4510:
/* 3DE510 E00E4510 064000BA */  bltz      $s2, .LE00E47FC
/* 3DE514 E00E4514 2A420002 */   slti     $v0, $s2, 0x2
/* 3DE518 E00E4518 14400005 */  bnez      $v0, .LE00E4530
/* 3DE51C E00E451C 2A420004 */   slti     $v0, $s2, 0x4
/* 3DE520 E00E4520 104000B6 */  beqz      $v0, .LE00E47FC
/* 3DE524 E00E4524 00000000 */   nop
/* 3DE528 E00E4528 0803919A */  j         .LE00E4668
/* 3DE52C E00E452C 00000000 */   nop
.LE00E4530:
/* 3DE530 E00E4530 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE534 E00E4534 14400020 */  bnez      $v0, .LE00E45B8
/* 3DE538 E00E4538 2404000A */   addiu    $a0, $zero, 0xA
/* 3DE53C E00E453C AE00FFC0 */  sw        $zero, -0x40($s0)
/* 3DE540 E00E4540 AE00FFC4 */  sw        $zero, -0x3C($s0)
/* 3DE544 E00E4544 0C080138 */  jal       shim_rand_int
/* 3DE548 E00E4548 AE00FFCC */   sw       $zero, -0x34($s0)
/* 3DE54C E00E454C 00021023 */  negu      $v0, $v0
/* 3DE550 E00E4550 2442FFFE */  addiu     $v0, $v0, -0x2
/* 3DE554 E00E4554 44820000 */  mtc1      $v0, $f0
/* 3DE558 E00E4558 00000000 */  nop
/* 3DE55C E00E455C 46800020 */  cvt.s.w   $f0, $f0
/* 3DE560 E00E4560 46000021 */  cvt.d.s   $f0, $f0
/* 3DE564 E00E4564 46380002 */  mul.d     $f0, $f0, $f24
/* 3DE568 E00E4568 00000000 */  nop
/* 3DE56C E00E456C 2404000A */  addiu     $a0, $zero, 0xA
/* 3DE570 E00E4570 AE000004 */  sw        $zero, 0x4($s0)
/* 3DE574 E00E4574 AE000008 */  sw        $zero, 0x8($s0)
/* 3DE578 E00E4578 46200020 */  cvt.s.d   $f0, $f0
/* 3DE57C E00E457C 0C080138 */  jal       shim_rand_int
/* 3DE580 E00E4580 E600FFD0 */   swc1     $f0, -0x30($s0)
/* 3DE584 E00E4584 44820000 */  mtc1      $v0, $f0
/* 3DE588 E00E4588 00000000 */  nop
/* 3DE58C E00E458C 46800020 */  cvt.s.w   $f0, $f0
/* 3DE590 E00E4590 46000021 */  cvt.d.s   $f0, $f0
/* 3DE594 E00E4594 46380002 */  mul.d     $f0, $f0, $f24
/* 3DE598 E00E4598 00000000 */  nop
/* 3DE59C E00E459C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 3DE5A0 E00E45A0 44811800 */  mtc1      $at, $f3
/* 3DE5A4 E00E45A4 44801000 */  mtc1      $zero, $f2
/* 3DE5A8 E00E45A8 00000000 */  nop
/* 3DE5AC E00E45AC 46220000 */  add.d     $f0, $f0, $f2
/* 3DE5B0 E00E45B0 46200020 */  cvt.s.d   $f0, $f0
/* 3DE5B4 E00E45B4 E6000000 */  swc1      $f0, 0x0($s0)
.LE00E45B8:
/* 3DE5B8 E00E45B8 C60CFFC0 */  lwc1      $f12, -0x40($s0)
/* 3DE5BC E00E45BC C60AFFCC */  lwc1      $f10, -0x34($s0)
/* 3DE5C0 E00E45C0 460C5281 */  sub.s     $f10, $f10, $f12
/* 3DE5C4 E00E45C4 460052A1 */  cvt.d.s   $f10, $f10
/* 3DE5C8 E00E45C8 46365282 */  mul.d     $f10, $f10, $f22
/* 3DE5CC E00E45CC 00000000 */  nop
/* 3DE5D0 E00E45D0 C608FFC4 */  lwc1      $f8, -0x3C($s0)
/* 3DE5D4 E00E45D4 C606FFD0 */  lwc1      $f6, -0x30($s0)
/* 3DE5D8 E00E45D8 C604FFAC */  lwc1      $f4, -0x54($s0)
/* 3DE5DC E00E45DC 46083181 */  sub.s     $f6, $f6, $f8
/* 3DE5E0 E00E45E0 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE5E4 E00E45E4 46006006 */  mov.s     $f0, $f12
/* 3DE5E8 E00E45E8 46002100 */  add.s     $f4, $f4, $f0
/* 3DE5EC E00E45EC C600FFB0 */  lwc1      $f0, -0x50($s0)
/* 3DE5F0 E00E45F0 46004086 */  mov.s     $f2, $f8
/* 3DE5F4 E00E45F4 46020000 */  add.s     $f0, $f0, $f2
/* 3DE5F8 E00E45F8 3C01E00E */  lui       $at, (0xE00E4E00 >> 16)
/* 3DE5FC E00E45FC 00220821 */  addu      $at, $at, $v0
/* 3DE600 E00E4600 90224E00 */  lbu       $v0, (0xE00E4E00 & 0xFFFF)($at)
/* 3DE604 E00E4604 460031A1 */  cvt.d.s   $f6, $f6
/* 3DE608 E00E4608 46363182 */  mul.d     $f6, $f6, $f22
/* 3DE60C E00E460C 00000000 */  nop
/* 3DE610 E00E4610 3C01E00E */  lui       $at, (0xE00E4E30 >> 16)
/* 3DE614 E00E4614 D4224E30 */  ldc1      $f2, (0xE00E4E30 & 0xFFFF)($at)
/* 3DE618 E00E4618 46006321 */  cvt.d.s   $f12, $f12
/* 3DE61C E00E461C E600FFB0 */  swc1      $f0, -0x50($s0)
/* 3DE620 E00E4620 C6000004 */  lwc1      $f0, 0x4($s0)
/* 3DE624 E00E4624 46004221 */  cvt.d.s   $f8, $f8
/* 3DE628 E00E4628 E604FFAC */  swc1      $f4, -0x54($s0)
/* 3DE62C E00E462C 46000021 */  cvt.d.s   $f0, $f0
/* 3DE630 E00E4630 46220000 */  add.d     $f0, $f0, $f2
/* 3DE634 E00E4634 C6020008 */  lwc1      $f2, 0x8($s0)
/* 3DE638 E00E4638 3C01E00E */  lui       $at, (0xE00E4E38 >> 16)
/* 3DE63C E00E463C D4244E38 */  ldc1      $f4, (0xE00E4E38 & 0xFFFF)($at)
/* 3DE640 E00E4640 460010A1 */  cvt.d.s   $f2, $f2
/* 3DE644 E00E4644 46241080 */  add.d     $f2, $f2, $f4
/* 3DE648 E00E4648 AE02FFEC */  sw        $v0, -0x14($s0)
/* 3DE64C E00E464C 46200020 */  cvt.s.d   $f0, $f0
/* 3DE650 E00E4650 462A6300 */  add.d     $f12, $f12, $f10
/* 3DE654 E00E4654 E6000004 */  swc1      $f0, 0x4($s0)
/* 3DE658 E00E4658 462010A0 */  cvt.s.d   $f2, $f2
/* 3DE65C E00E465C 46264200 */  add.d     $f8, $f8, $f6
/* 3DE660 E00E4660 080391FA */  j         .LE00E47E8
/* 3DE664 E00E4664 E6020008 */   swc1     $f2, 0x8($s0)
.LE00E4668:
/* 3DE668 E00E4668 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE66C E00E466C 1440002D */  bnez      $v0, .LE00E4724
/* 3DE670 E00E4670 00571021 */   addu     $v0, $v0, $s7
/* 3DE674 E00E4674 24020002 */  addiu     $v0, $zero, 0x2
/* 3DE678 E00E4678 56420018 */  bnel      $s2, $v0, .LE00E46DC
/* 3DE67C E00E467C AE00FFC0 */   sw       $zero, -0x40($s0)
/* 3DE680 E00E4680 0C080138 */  jal       shim_rand_int
/* 3DE684 E00E4684 24040014 */   addiu    $a0, $zero, 0x14
/* 3DE688 E00E4688 2442FFF6 */  addiu     $v0, $v0, -0xA
/* 3DE68C E00E468C 44820000 */  mtc1      $v0, $f0
/* 3DE690 E00E4690 00000000 */  nop
/* 3DE694 E00E4694 46800020 */  cvt.s.w   $f0, $f0
/* 3DE698 E00E4698 46000021 */  cvt.d.s   $f0, $f0
/* 3DE69C E00E469C 46380002 */  mul.d     $f0, $f0, $f24
/* 3DE6A0 E00E46A0 00000000 */  nop
/* 3DE6A4 E00E46A4 24040014 */  addiu     $a0, $zero, 0x14
/* 3DE6A8 E00E46A8 46200020 */  cvt.s.d   $f0, $f0
/* 3DE6AC E00E46AC 0C080138 */  jal       shim_rand_int
/* 3DE6B0 E00E46B0 E600FFC0 */   swc1     $f0, -0x40($s0)
/* 3DE6B4 E00E46B4 2442FFF6 */  addiu     $v0, $v0, -0xA
/* 3DE6B8 E00E46B8 44820000 */  mtc1      $v0, $f0
/* 3DE6BC E00E46BC 00000000 */  nop
/* 3DE6C0 E00E46C0 46800020 */  cvt.s.w   $f0, $f0
/* 3DE6C4 E00E46C4 46000021 */  cvt.d.s   $f0, $f0
/* 3DE6C8 E00E46C8 46380002 */  mul.d     $f0, $f0, $f24
/* 3DE6CC E00E46CC 00000000 */  nop
/* 3DE6D0 E00E46D0 46200020 */  cvt.s.d   $f0, $f0
/* 3DE6D4 E00E46D4 080391B8 */  j         .LE00E46E0
/* 3DE6D8 E00E46D8 E600FFC4 */   swc1     $f0, -0x3C($s0)
.LE00E46DC:
/* 3DE6DC E00E46DC AE00FFC4 */  sw        $zero, -0x3C($s0)
.LE00E46E0:
/* 3DE6E0 E00E46E0 2404000F */  addiu     $a0, $zero, 0xF
/* 3DE6E4 E00E46E4 AE00FFCC */  sw        $zero, -0x34($s0)
/* 3DE6E8 E00E46E8 0C080138 */  jal       shim_rand_int
/* 3DE6EC E00E46EC AE00FFD0 */   sw       $zero, -0x30($s0)
/* 3DE6F0 E00E46F0 2404000F */  addiu     $a0, $zero, 0xF
/* 3DE6F4 E00E46F4 44820000 */  mtc1      $v0, $f0
/* 3DE6F8 E00E46F8 00000000 */  nop
/* 3DE6FC E00E46FC 46800020 */  cvt.s.w   $f0, $f0
/* 3DE700 E00E4700 0C080138 */  jal       shim_rand_int
/* 3DE704 E00E4704 E6000004 */   swc1     $f0, 0x4($s0)
/* 3DE708 E00E4708 44820000 */  mtc1      $v0, $f0
/* 3DE70C E00E470C 00000000 */  nop
/* 3DE710 E00E4710 46800020 */  cvt.s.w   $f0, $f0
/* 3DE714 E00E4714 E6000008 */  swc1      $f0, 0x8($s0)
/* 3DE718 E00E4718 AE16FFEC */  sw        $s6, -0x14($s0)
/* 3DE71C E00E471C 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE720 E00E4720 00571021 */  addu      $v0, $v0, $s7
.LE00E4724:
/* 3DE724 E00E4724 90420000 */  lbu       $v0, 0x0($v0)
/* 3DE728 E00E4728 3C01E00E */  lui       $at, (0xE00E4E40 >> 16)
/* 3DE72C E00E472C D4204E40 */  ldc1      $f0, (0xE00E4E40 & 0xFFFF)($at)
/* 3DE730 E00E4730 44827000 */  mtc1      $v0, $f14
/* 3DE734 E00E4734 00000000 */  nop
/* 3DE738 E00E4738 468073A0 */  cvt.s.w   $f14, $f14
/* 3DE73C E00E473C 460073A1 */  cvt.d.s   $f14, $f14
/* 3DE740 E00E4740 46207382 */  mul.d     $f14, $f14, $f0
/* 3DE744 E00E4744 00000000 */  nop
/* 3DE748 E00E4748 C60CFFC0 */  lwc1      $f12, -0x40($s0)
/* 3DE74C E00E474C C60AFFCC */  lwc1      $f10, -0x34($s0)
/* 3DE750 E00E4750 460C5281 */  sub.s     $f10, $f10, $f12
/* 3DE754 E00E4754 460052A1 */  cvt.d.s   $f10, $f10
/* 3DE758 E00E4758 46365282 */  mul.d     $f10, $f10, $f22
/* 3DE75C E00E475C 00000000 */  nop
/* 3DE760 E00E4760 C608FFC4 */  lwc1      $f8, -0x3C($s0)
/* 3DE764 E00E4764 C606FFD0 */  lwc1      $f6, -0x30($s0)
/* 3DE768 E00E4768 46083181 */  sub.s     $f6, $f6, $f8
/* 3DE76C E00E476C C604FFAC */  lwc1      $f4, -0x54($s0)
/* 3DE770 E00E4770 46006006 */  mov.s     $f0, $f12
/* 3DE774 E00E4774 46002100 */  add.s     $f4, $f4, $f0
/* 3DE778 E00E4778 C602FFB0 */  lwc1      $f2, -0x50($s0)
/* 3DE77C E00E477C 46004006 */  mov.s     $f0, $f8
/* 3DE780 E00E4780 46001080 */  add.s     $f2, $f2, $f0
/* 3DE784 E00E4784 460031A1 */  cvt.d.s   $f6, $f6
/* 3DE788 E00E4788 46363182 */  mul.d     $f6, $f6, $f22
/* 3DE78C E00E478C 00000000 */  nop
/* 3DE790 E00E4790 3C01E00E */  lui       $at, (0xE00E4E48 >> 16)
/* 3DE794 E00E4794 D4204E48 */  ldc1      $f0, (0xE00E4E48 & 0xFFFF)($at)
/* 3DE798 E00E4798 46006321 */  cvt.d.s   $f12, $f12
/* 3DE79C E00E479C E602FFB0 */  swc1      $f2, -0x50($s0)
/* 3DE7A0 E00E47A0 C6020004 */  lwc1      $f2, 0x4($s0)
/* 3DE7A4 E00E47A4 46004221 */  cvt.d.s   $f8, $f8
/* 3DE7A8 E00E47A8 E604FFAC */  swc1      $f4, -0x54($s0)
/* 3DE7AC E00E47AC 460010A1 */  cvt.d.s   $f2, $f2
/* 3DE7B0 E00E47B0 46201080 */  add.d     $f2, $f2, $f0
/* 3DE7B4 E00E47B4 C6000008 */  lwc1      $f0, 0x8($s0)
/* 3DE7B8 E00E47B8 3C01E00E */  lui       $at, (0xE00E4E50 >> 16)
/* 3DE7BC E00E47BC D4244E50 */  ldc1      $f4, (0xE00E4E50 & 0xFFFF)($at)
/* 3DE7C0 E00E47C0 46000021 */  cvt.d.s   $f0, $f0
/* 3DE7C4 E00E47C4 46240000 */  add.d     $f0, $f0, $f4
/* 3DE7C8 E00E47C8 462010A0 */  cvt.s.d   $f2, $f2
/* 3DE7CC E00E47CC E6020004 */  swc1      $f2, 0x4($s0)
/* 3DE7D0 E00E47D0 46200020 */  cvt.s.d   $f0, $f0
/* 3DE7D4 E00E47D4 462A6300 */  add.d     $f12, $f12, $f10
/* 3DE7D8 E00E47D8 E6000008 */  swc1      $f0, 0x8($s0)
/* 3DE7DC E00E47DC 462073A0 */  cvt.s.d   $f14, $f14
/* 3DE7E0 E00E47E0 46264200 */  add.d     $f8, $f8, $f6
/* 3DE7E4 E00E47E4 E60E0000 */  swc1      $f14, 0x0($s0)
.LE00E47E8:
/* 3DE7E8 E00E47E8 46206320 */  cvt.s.d   $f12, $f12
/* 3DE7EC E00E47EC 46204220 */  cvt.s.d   $f8, $f8
/* 3DE7F0 E00E47F0 E60CFFC0 */  swc1      $f12, -0x40($s0)
/* 3DE7F4 E00E47F4 0803922C */  j         .LE00E48B0
/* 3DE7F8 E00E47F8 E608FFC4 */   swc1     $f8, -0x3C($s0)
.LE00E47FC:
/* 3DE7FC E00E47FC 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE800 E00E4800 14400017 */  bnez      $v0, .LE00E4860
/* 3DE804 E00E4804 24020004 */   addiu    $v0, $zero, 0x4
/* 3DE808 E00E4808 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3DE80C E00E480C 44810000 */  mtc1      $at, $f0
/* 3DE810 E00E4810 2404007F */  addiu     $a0, $zero, 0x7F
/* 3DE814 E00E4814 AE000004 */  sw        $zero, 0x4($s0)
/* 3DE818 E00E4818 AE000008 */  sw        $zero, 0x8($s0)
/* 3DE81C E00E481C AE16FFEC */  sw        $s6, -0x14($s0)
/* 3DE820 E00E4820 0C080138 */  jal       shim_rand_int
/* 3DE824 E00E4824 E6000000 */   swc1     $f0, 0x0($s0)
/* 3DE828 E00E4828 24420080 */  addiu     $v0, $v0, 0x80
/* 3DE82C E00E482C 02C22023 */  subu      $a0, $s6, $v0
/* 3DE830 E00E4830 0C080138 */  jal       shim_rand_int
/* 3DE834 E00E4834 AE02FFE0 */   sw       $v0, -0x20($s0)
/* 3DE838 E00E4838 24420080 */  addiu     $v0, $v0, 0x80
/* 3DE83C E00E483C 2404017F */  addiu     $a0, $zero, 0x17F
/* 3DE840 E00E4840 8E03FFE0 */  lw        $v1, -0x20($s0)
/* 3DE844 E00E4844 00822023 */  subu      $a0, $a0, $v0
/* 3DE848 E00E4848 AE02FFE4 */  sw        $v0, -0x1C($s0)
/* 3DE84C E00E484C 0C080138 */  jal       shim_rand_int
/* 3DE850 E00E4850 00832023 */   subu     $a0, $a0, $v1
/* 3DE854 E00E4854 24420080 */  addiu     $v0, $v0, 0x80
/* 3DE858 E00E4858 AE02FFE8 */  sw        $v0, -0x18($s0)
/* 3DE85C E00E485C 24020004 */  addiu     $v0, $zero, 0x4
.LE00E4860:
/* 3DE860 E00E4860 16420006 */  bne       $s2, $v0, .LE00E487C
/* 3DE864 E00E4864 00000000 */   nop
/* 3DE868 E00E4868 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE86C E00E486C 3C01E00E */  lui       $at, (0xE00E4DE0 >> 16)
/* 3DE870 E00E4870 00220821 */  addu      $at, $at, $v0
/* 3DE874 E00E4874 08039222 */  j         .LE00E4888
/* 3DE878 E00E4878 90224DE0 */   lbu      $v0, (0xE00E4DE0 & 0xFFFF)($at)
.LE00E487C:
/* 3DE87C E00E487C 8E02FFD4 */  lw        $v0, -0x2C($s0)
/* 3DE880 E00E4880 00571021 */  addu      $v0, $v0, $s7
/* 3DE884 E00E4884 90420000 */  lbu       $v0, 0x0($v0)
.LE00E4888:
/* 3DE888 E00E4888 3C01E00E */  lui       $at, (0xE00E4E58 >> 16)
/* 3DE88C E00E488C D4224E58 */  ldc1      $f2, (0xE00E4E58 & 0xFFFF)($at)
/* 3DE890 E00E4890 44820000 */  mtc1      $v0, $f0
/* 3DE894 E00E4894 00000000 */  nop
/* 3DE898 E00E4898 46800020 */  cvt.s.w   $f0, $f0
/* 3DE89C E00E489C 46000021 */  cvt.d.s   $f0, $f0
/* 3DE8A0 E00E48A0 46220002 */  mul.d     $f0, $f0, $f2
/* 3DE8A4 E00E48A4 00000000 */  nop
/* 3DE8A8 E00E48A8 46200020 */  cvt.s.d   $f0, $f0
/* 3DE8AC E00E48AC E6000000 */  swc1      $f0, 0x0($s0)
.LE00E48B0:
/* 3DE8B0 E00E48B0 26730001 */  addiu     $s3, $s3, 0x1
.LE00E48B4:
/* 3DE8B4 E00E48B4 8E820008 */  lw        $v0, 0x8($s4)
/* 3DE8B8 E00E48B8 0262102A */  slt       $v0, $s3, $v0
/* 3DE8BC E00E48BC 1440FEDA */  bnez      $v0, .LE00E4428
/* 3DE8C0 E00E48C0 26100064 */   addiu    $s0, $s0, 0x64
.LE00E48C4:
/* 3DE8C4 E00E48C4 8FBF004C */  lw        $ra, 0x4C($sp)
/* 3DE8C8 E00E48C8 8FBE0048 */  lw        $fp, 0x48($sp)
/* 3DE8CC E00E48CC 8FB70044 */  lw        $s7, 0x44($sp)
/* 3DE8D0 E00E48D0 8FB60040 */  lw        $s6, 0x40($sp)
/* 3DE8D4 E00E48D4 8FB5003C */  lw        $s5, 0x3C($sp)
/* 3DE8D8 E00E48D8 8FB40038 */  lw        $s4, 0x38($sp)
/* 3DE8DC E00E48DC 8FB30034 */  lw        $s3, 0x34($sp)
/* 3DE8E0 E00E48E0 8FB20030 */  lw        $s2, 0x30($sp)
/* 3DE8E4 E00E48E4 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3DE8E8 E00E48E8 8FB00028 */  lw        $s0, 0x28($sp)
/* 3DE8EC E00E48EC D7BE0078 */  ldc1      $f30, 0x78($sp)
/* 3DE8F0 E00E48F0 D7BC0070 */  ldc1      $f28, 0x70($sp)
/* 3DE8F4 E00E48F4 D7BA0068 */  ldc1      $f26, 0x68($sp)
/* 3DE8F8 E00E48F8 D7B80060 */  ldc1      $f24, 0x60($sp)
/* 3DE8FC E00E48FC D7B60058 */  ldc1      $f22, 0x58($sp)
/* 3DE900 E00E4900 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 3DE904 E00E4904 03E00008 */  jr        $ra
/* 3DE908 E00E4908 27BD0080 */   addiu    $sp, $sp, 0x80

### DECOMPILED C INSTRUCTIONS:

void misc_particles_update(EffectInstance* effect) {
    MiscParticlesFXData* particle = effect->data.miscParticles;
    s32 variation = particle->variation;
    f32 scaleX;
    f32 scaleY;
    f32 posX;
    f32 posY;
    f32 posZ;
    s32 timeLeft;
    s32 innerColorR;
    s32 innerColorG;
    s32 innerColorB;
    f32 temp_sin;
    f32 temp_cos;
    s32 i;

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

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

    particle->lifetime++;

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

    timeLeft = particle->timeLeft;

    if (particle->timeLeft < 8) {
        particle->innerColor.a = particle->timeLeft * 32;
    }

    scaleX = particle->scaleX;
    scaleY = particle->scaleY;
    posX = particle->pos.x;
    posY = particle->pos.y;
    posZ = particle->pos.z;
    temp_cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw);
    temp_sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw);
    innerColorR = particle->innerColor.r;
    innerColorG = particle->innerColor.g;
    innerColorB = particle->innerColor.b;

    particle++;
    for (i = 1; i < effect->numParts; i++, particle++) {
        particle->animTime++;
        if (particle->animTime >= 30) {
            if (timeLeft < 30) {
                // perform final fadeout
                particle->animTime = 20;
            } else {
                // recycle the particle
                particle->animTime = 0;
            }
        }

        if (particle->animTime >= 0) {
            if (particle->animTime == 0) {
                f32 randMag = shim_rand_int(scaleX) - scaleX * 0.5;
                particle->pos.x = posX + randMag * temp_cos - temp_sin;
                particle->pos.y = posY + shim_rand_int(scaleY);
                particle->pos.z = posZ + randMag * temp_sin + temp_cos;
                particle->innerColor.r = innerColorR;
                particle->innerColor.g = innerColorG;
                particle->innerColor.b = innerColorB;
            }

            switch (variation) {
                case 0:
                case 1:
                    if (particle->animTime == 0) {
                        particle->unk_18 = 0.0f;
                        particle->unk_1C = 0.0f;
                        particle->unk_24 = 0.0f;
                        particle->unk_28 = (f32) (-shim_rand_int(10) - 2) * 0.05;
                        particle->unk_5C = 0.0f;
                        particle->unk_60 = 0.0f;
                        particle->scale = (f32) shim_rand_int(10) * 0.05 + 0.5;
                    }
                    particle->innerColor.a = D_E00E4E00[particle->animTime];
                    particle->pos.x += particle->unk_18;
                    particle->pos.y += particle->unk_1C;
                    particle->unk_5C += 0.2;
                    particle->unk_60 += 0.6;
                    particle->unk_18 += (particle->unk_24 - particle->unk_18) * 0.04;
                    particle->unk_1C += (particle->unk_28 - particle->unk_1C) * 0.04;
                    break;
                case 2:
                case 3:
                    if (particle->animTime == 0) {
                        if (variation == 2) {
                            particle->unk_18 = (f32) (shim_rand_int(20) - 10) * 0.05;
                            particle->unk_1C = (f32) (shim_rand_int(20) - 10) * 0.05;
                        } else {
                            particle->unk_18 = 0.0f;
                            particle->unk_1C = 0.0f;
                        }
                        particle->unk_24 = 0.0f;
                        particle->unk_28 = 0.0f;
                        particle->unk_5C = shim_rand_int(15);
                        particle->unk_60 = shim_rand_int(15);
                        particle->innerColor.a = 255;
                    }
                    particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.1;
                    particle->pos.x += particle->unk_18;
                    particle->pos.y += particle->unk_1C;
                    particle->unk_5C += 0.2;
                    particle->unk_60 += 0.6;
                    particle->unk_18 += (particle->unk_24 - particle->unk_18) * 0.04;
                    particle->unk_1C += (particle->unk_28 - particle->unk_1C) * 0.04;
                    break;
                default:
                    if (particle->animTime == 0) {
                        particle->unk_5C = 0.0f;
                        particle->unk_60 = 0.0f;
                        particle->innerColor.a = 255;
                        particle->scale = 1.0f;
                        particle->innerColor.r = shim_rand_int(127) + 128;
                        particle->innerColor.g = shim_rand_int(255 - particle->innerColor.r) + 128;
                        particle->innerColor.b = shim_rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128;
                    }
                    if (variation == 4) {
                        particle->scale = (f32) D_E00E4DE0[particle->animTime] * 0.01;
                    } else {
                        particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.01;
                    }
                    break;
            }
        }
    }
}