### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_entity_model_E
/* B8988 80122288 27BDFF08 */  addiu     $sp, $sp, -0xF8
/* B898C 8012228C 2402F7FF */  addiu     $v0, $zero, -0x801
/* B8990 80122290 00822024 */  and       $a0, $a0, $v0
/* B8994 80122294 3C028015 */  lui       $v0, %hi(gCurrentEntityModelList)
/* B8998 80122298 8C424370 */  lw        $v0, %lo(gCurrentEntityModelList)($v0)
/* B899C 8012229C 00042080 */  sll       $a0, $a0, 2
/* B89A0 801222A0 AFBF00F4 */  sw        $ra, 0xF4($sp)
/* B89A4 801222A4 AFB200F0 */  sw        $s2, 0xF0($sp)
/* B89A8 801222A8 AFB100EC */  sw        $s1, 0xEC($sp)
/* B89AC 801222AC AFB000E8 */  sw        $s0, 0xE8($sp)
/* B89B0 801222B0 00822021 */  addu      $a0, $a0, $v0
/* B89B4 801222B4 8C920000 */  lw        $s2, 0x0($a0)
/* B89B8 801222B8 124002AA */  beqz      $s2, .L80122D64
/* B89BC 801222BC 00000000 */   nop
/* B89C0 801222C0 8E430000 */  lw        $v1, 0x0($s2)
/* B89C4 801222C4 106002A7 */  beqz      $v1, .L80122D64
/* B89C8 801222C8 30620100 */   andi     $v0, $v1, 0x100
/* B89CC 801222CC 144002A5 */  bnez      $v0, .L80122D64
/* B89D0 801222D0 30620020 */   andi     $v0, $v1, 0x20
/* B89D4 801222D4 144002A3 */  bnez      $v0, .L80122D64
/* B89D8 801222D8 30620040 */   andi     $v0, $v1, 0x40
/* B89DC 801222DC 144002A1 */  bnez      $v0, .L80122D64
/* B89E0 801222E0 30620008 */   andi     $v0, $v1, 0x8
/* B89E4 801222E4 1040029F */  beqz      $v0, .L80122D64
/* B89E8 801222E8 26420018 */   addiu    $v0, $s2, 0x18
/* B89EC 801222EC 24A30040 */  addiu     $v1, $a1, 0x40
.L801222F0:
/* B89F0 801222F0 8CAE0000 */  lw        $t6, 0x0($a1)
/* B89F4 801222F4 8CAF0004 */  lw        $t7, 0x4($a1)
/* B89F8 801222F8 8CB80008 */  lw        $t8, 0x8($a1)
/* B89FC 801222FC 8CB9000C */  lw        $t9, 0xC($a1)
/* B8A00 80122300 AC4E0000 */  sw        $t6, 0x0($v0)
/* B8A04 80122304 AC4F0004 */  sw        $t7, 0x4($v0)
/* B8A08 80122308 AC580008 */  sw        $t8, 0x8($v0)
/* B8A0C 8012230C AC59000C */  sw        $t9, 0xC($v0)
/* B8A10 80122310 24A50010 */  addiu     $a1, $a1, 0x10
/* B8A14 80122314 14A3FFF6 */  bne       $a1, $v1, .L801222F0
/* B8A18 80122318 24420010 */   addiu    $v0, $v0, 0x10
/* B8A1C 8012231C 3C020001 */  lui       $v0, (0x11630 >> 16)
/* B8A20 80122320 34421630 */  ori       $v0, $v0, (0x11630 & 0xFFFF)
/* B8A24 80122324 26450018 */  addiu     $a1, $s2, 0x18
/* B8A28 80122328 3C038007 */  lui       $v1, %hi(gMatrixListPos)
/* B8A2C 8012232C 946341F0 */  lhu       $v1, %lo(gMatrixListPos)($v1)
/* B8A30 80122330 3C04800A */  lui       $a0, %hi(gDisplayContext)
/* B8A34 80122334 8C84A674 */  lw        $a0, %lo(gDisplayContext)($a0)
/* B8A38 80122338 26460058 */  addiu     $a2, $s2, 0x58
/* B8A3C 8012233C AE40005C */  sw        $zero, 0x5C($s2)
/* B8A40 80122340 00031980 */  sll       $v1, $v1, 6
/* B8A44 80122344 00832021 */  addu      $a0, $a0, $v1
/* B8A48 80122348 00822021 */  addu      $a0, $a0, $v0
.L8012234C:
/* B8A4C 8012234C 8CAE0000 */  lw        $t6, 0x0($a1)
/* B8A50 80122350 8CAF0004 */  lw        $t7, 0x4($a1)
/* B8A54 80122354 8CB80008 */  lw        $t8, 0x8($a1)
/* B8A58 80122358 8CB9000C */  lw        $t9, 0xC($a1)
/* B8A5C 8012235C AC8E0000 */  sw        $t6, 0x0($a0)
/* B8A60 80122360 AC8F0004 */  sw        $t7, 0x4($a0)
/* B8A64 80122364 AC980008 */  sw        $t8, 0x8($a0)
/* B8A68 80122368 AC99000C */  sw        $t9, 0xC($a0)
/* B8A6C 8012236C 24A50010 */  addiu     $a1, $a1, 0x10
/* B8A70 80122370 14A6FFF6 */  bne       $a1, $a2, .L8012234C
/* B8A74 80122374 24840010 */   addiu    $a0, $a0, 0x10
/* B8A78 80122378 3C02DA38 */  lui       $v0, (0xDA380002 >> 16)
/* B8A7C 8012237C 34420002 */  ori       $v0, $v0, (0xDA380002 & 0xFFFF)
/* B8A80 80122380 3C070001 */  lui       $a3, (0x11630 >> 16)
/* B8A84 80122384 3C0D800A */  lui       $t5, %hi(gMainGfxPos)
/* B8A88 80122388 25ADA66C */  addiu     $t5, $t5, %lo(gMainGfxPos)
/* B8A8C 8012238C 34E71630 */  ori       $a3, $a3, (0x11630 & 0xFFFF)
/* B8A90 80122390 3C068007 */  lui       $a2, %hi(gMatrixListPos)
/* B8A94 80122394 24C641F0 */  addiu     $a2, $a2, %lo(gMatrixListPos)
/* B8A98 80122398 8DAC0000 */  lw        $t4, 0x0($t5)
/* B8A9C 8012239C 94C40000 */  lhu       $a0, 0x0($a2)
/* B8AA0 801223A0 0180282D */  daddu     $a1, $t4, $zero
/* B8AA4 801223A4 258C0008 */  addiu     $t4, $t4, 0x8
/* B8AA8 801223A8 ADAC0000 */  sw        $t4, 0x0($t5)
/* B8AAC 801223AC ACA20000 */  sw        $v0, 0x0($a1)
/* B8AB0 801223B0 3082FFFF */  andi      $v0, $a0, 0xFFFF
/* B8AB4 801223B4 00021180 */  sll       $v0, $v0, 6
/* B8AB8 801223B8 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* B8ABC 801223BC 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* B8AC0 801223C0 00471021 */  addu      $v0, $v0, $a3
/* B8AC4 801223C4 00621821 */  addu      $v1, $v1, $v0
/* B8AC8 801223C8 ACA30004 */  sw        $v1, 0x4($a1)
/* B8ACC 801223CC 8E450000 */  lw        $a1, 0x0($s2)
/* B8AD0 801223D0 24840001 */  addiu     $a0, $a0, 0x1
/* B8AD4 801223D4 30A20400 */  andi      $v0, $a1, 0x400
/* B8AD8 801223D8 144001F6 */  bnez      $v0, .L80122BB4
/* B8ADC 801223DC A4C40000 */   sh       $a0, 0x0($a2)
/* B8AE0 801223E0 3C028015 */  lui       $v0, %hi(entity_fog_enabled)
/* B8AE4 801223E4 8C424378 */  lw        $v0, %lo(entity_fog_enabled)($v0)
/* B8AE8 801223E8 10400003 */  beqz      $v0, .L801223F8
/* B8AEC 801223EC 0000182D */   daddu    $v1, $zero, $zero
/* B8AF0 801223F0 30A20800 */  andi      $v0, $a1, 0x800
/* B8AF4 801223F4 2C430001 */  sltiu     $v1, $v0, 0x1
.L801223F8:
/* B8AF8 801223F8 10600005 */  beqz      $v1, .L80122410
/* B8AFC 801223FC 24020001 */   addiu    $v0, $zero, 0x1
/* B8B00 80122400 106200C3 */  beq       $v1, $v0, .L80122710
/* B8B04 80122404 3C02D9FD */   lui      $v0, (0xD9FDFFFF >> 16)
/* B8B08 80122408 08048A61 */  j         .L80122984
/* B8B0C 8012240C 00000000 */   nop
.L80122410:
/* B8B10 80122410 92420004 */  lbu       $v0, 0x4($s2)
/* B8B14 80122414 2442FFFF */  addiu     $v0, $v0, -0x1
/* B8B18 80122418 00021600 */  sll       $v0, $v0, 24
/* B8B1C 8012241C 00021E03 */  sra       $v1, $v0, 24
/* B8B20 80122420 2C62002D */  sltiu     $v0, $v1, 0x2D
/* B8B24 80122424 10400156 */  beqz      $v0, .L80122980
/* B8B28 80122428 00031080 */   sll      $v0, $v1, 2
/* B8B2C 8012242C 3C018015 */  lui       $at, %hi(jtbl_80150220)
/* B8B30 80122430 00220821 */  addu      $at, $at, $v0
/* B8B34 80122434 8C220220 */  lw        $v0, %lo(jtbl_80150220)($at)
/* B8B38 80122438 00400008 */  jr        $v0
/* B8B3C 8012243C 00000000 */   nop
glabel .L80122440
/* B8B40 80122440 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8B44 80122444 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8B48 80122448 8C620000 */  lw        $v0, 0x0($v1)
/* B8B4C 8012244C 0040202D */  daddu     $a0, $v0, $zero
/* B8B50 80122450 24420008 */  addiu     $v0, $v0, 0x8
/* B8B54 80122454 AC620000 */  sw        $v0, 0x0($v1)
/* B8B58 80122458 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8B5C 8012245C AC820000 */  sw        $v0, 0x0($a0)
/* B8B60 80122460 3C028015 */  lui       $v0, %hi(D_8014B7F8)
/* B8B64 80122464 2442B7F8 */  addiu     $v0, $v0, %lo(D_8014B7F8)
/* B8B68 80122468 08048A60 */  j         .L80122980
/* B8B6C 8012246C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122470
/* B8B70 80122470 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8B74 80122474 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8B78 80122478 8C620000 */  lw        $v0, 0x0($v1)
/* B8B7C 8012247C 0040202D */  daddu     $a0, $v0, $zero
/* B8B80 80122480 24420008 */  addiu     $v0, $v0, 0x8
/* B8B84 80122484 AC620000 */  sw        $v0, 0x0($v1)
/* B8B88 80122488 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8B8C 8012248C AC820000 */  sw        $v0, 0x0($a0)
/* B8B90 80122490 3C028015 */  lui       $v0, %hi(D_8014B820)
/* B8B94 80122494 2442B820 */  addiu     $v0, $v0, %lo(D_8014B820)
/* B8B98 80122498 08048A60 */  j         .L80122980
/* B8B9C 8012249C AC820004 */   sw       $v0, 0x4($a0)
glabel .L801224A0
/* B8BA0 801224A0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8BA4 801224A4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8BA8 801224A8 8C620000 */  lw        $v0, 0x0($v1)
/* B8BAC 801224AC 0040202D */  daddu     $a0, $v0, $zero
/* B8BB0 801224B0 24420008 */  addiu     $v0, $v0, 0x8
/* B8BB4 801224B4 AC620000 */  sw        $v0, 0x0($v1)
/* B8BB8 801224B8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8BBC 801224BC AC820000 */  sw        $v0, 0x0($a0)
/* B8BC0 801224C0 3C028015 */  lui       $v0, %hi(D_8014B848)
/* B8BC4 801224C4 2442B848 */  addiu     $v0, $v0, %lo(D_8014B848)
/* B8BC8 801224C8 08048A60 */  j         .L80122980
/* B8BCC 801224CC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801224D0
/* B8BD0 801224D0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8BD4 801224D4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8BD8 801224D8 8C620000 */  lw        $v0, 0x0($v1)
/* B8BDC 801224DC 0040202D */  daddu     $a0, $v0, $zero
/* B8BE0 801224E0 24420008 */  addiu     $v0, $v0, 0x8
/* B8BE4 801224E4 AC620000 */  sw        $v0, 0x0($v1)
/* B8BE8 801224E8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8BEC 801224EC AC820000 */  sw        $v0, 0x0($a0)
/* B8BF0 801224F0 3C028015 */  lui       $v0, %hi(D_8014B870)
/* B8BF4 801224F4 2442B870 */  addiu     $v0, $v0, %lo(D_8014B870)
/* B8BF8 801224F8 08048A60 */  j         .L80122980
/* B8BFC 801224FC AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122500
/* B8C00 80122500 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8C04 80122504 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8C08 80122508 8C620000 */  lw        $v0, 0x0($v1)
/* B8C0C 8012250C 0040202D */  daddu     $a0, $v0, $zero
/* B8C10 80122510 24420008 */  addiu     $v0, $v0, 0x8
/* B8C14 80122514 AC620000 */  sw        $v0, 0x0($v1)
/* B8C18 80122518 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8C1C 8012251C AC820000 */  sw        $v0, 0x0($a0)
/* B8C20 80122520 3C028015 */  lui       $v0, %hi(D_8014B898)
/* B8C24 80122524 2442B898 */  addiu     $v0, $v0, %lo(D_8014B898)
/* B8C28 80122528 08048A60 */  j         .L80122980
/* B8C2C 8012252C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122530
/* B8C30 80122530 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8C34 80122534 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8C38 80122538 8C620000 */  lw        $v0, 0x0($v1)
/* B8C3C 8012253C 0040202D */  daddu     $a0, $v0, $zero
/* B8C40 80122540 24420008 */  addiu     $v0, $v0, 0x8
/* B8C44 80122544 AC620000 */  sw        $v0, 0x0($v1)
/* B8C48 80122548 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8C4C 8012254C AC820000 */  sw        $v0, 0x0($a0)
/* B8C50 80122550 3C028015 */  lui       $v0, %hi(D_8014B9B0)
/* B8C54 80122554 2442B9B0 */  addiu     $v0, $v0, %lo(D_8014B9B0)
/* B8C58 80122558 08048A60 */  j         .L80122980
/* B8C5C 8012255C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122560
/* B8C60 80122560 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8C64 80122564 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8C68 80122568 8C620000 */  lw        $v0, 0x0($v1)
/* B8C6C 8012256C 0040202D */  daddu     $a0, $v0, $zero
/* B8C70 80122570 24420008 */  addiu     $v0, $v0, 0x8
/* B8C74 80122574 AC620000 */  sw        $v0, 0x0($v1)
/* B8C78 80122578 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8C7C 8012257C AC820000 */  sw        $v0, 0x0($a0)
/* B8C80 80122580 3C028015 */  lui       $v0, %hi(D_8014B8C0)
/* B8C84 80122584 2442B8C0 */  addiu     $v0, $v0, %lo(D_8014B8C0)
/* B8C88 80122588 08048A60 */  j         .L80122980
/* B8C8C 8012258C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122590
/* B8C90 80122590 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8C94 80122594 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8C98 80122598 8C620000 */  lw        $v0, 0x0($v1)
/* B8C9C 8012259C 0040202D */  daddu     $a0, $v0, $zero
/* B8CA0 801225A0 24420008 */  addiu     $v0, $v0, 0x8
/* B8CA4 801225A4 AC620000 */  sw        $v0, 0x0($v1)
/* B8CA8 801225A8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8CAC 801225AC AC820000 */  sw        $v0, 0x0($a0)
/* B8CB0 801225B0 3C028015 */  lui       $v0, %hi(D_8014B9D8)
/* B8CB4 801225B4 2442B9D8 */  addiu     $v0, $v0, %lo(D_8014B9D8)
/* B8CB8 801225B8 08048A60 */  j         .L80122980
/* B8CBC 801225BC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801225C0
/* B8CC0 801225C0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8CC4 801225C4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8CC8 801225C8 8C620000 */  lw        $v0, 0x0($v1)
/* B8CCC 801225CC 0040202D */  daddu     $a0, $v0, $zero
/* B8CD0 801225D0 24420008 */  addiu     $v0, $v0, 0x8
/* B8CD4 801225D4 AC620000 */  sw        $v0, 0x0($v1)
/* B8CD8 801225D8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8CDC 801225DC AC820000 */  sw        $v0, 0x0($a0)
/* B8CE0 801225E0 3C028015 */  lui       $v0, %hi(D_8014B8E8)
/* B8CE4 801225E4 2442B8E8 */  addiu     $v0, $v0, %lo(D_8014B8E8)
/* B8CE8 801225E8 08048A60 */  j         .L80122980
/* B8CEC 801225EC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801225F0
/* B8CF0 801225F0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8CF4 801225F4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8CF8 801225F8 8C620000 */  lw        $v0, 0x0($v1)
/* B8CFC 801225FC 0040202D */  daddu     $a0, $v0, $zero
/* B8D00 80122600 24420008 */  addiu     $v0, $v0, 0x8
/* B8D04 80122604 AC620000 */  sw        $v0, 0x0($v1)
/* B8D08 80122608 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8D0C 8012260C AC820000 */  sw        $v0, 0x0($a0)
/* B8D10 80122610 3C028015 */  lui       $v0, %hi(D_8014BA00)
/* B8D14 80122614 2442BA00 */  addiu     $v0, $v0, %lo(D_8014BA00)
/* B8D18 80122618 08048A60 */  j         .L80122980
/* B8D1C 8012261C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122620
/* B8D20 80122620 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8D24 80122624 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8D28 80122628 8C620000 */  lw        $v0, 0x0($v1)
/* B8D2C 8012262C 0040202D */  daddu     $a0, $v0, $zero
/* B8D30 80122630 24420008 */  addiu     $v0, $v0, 0x8
/* B8D34 80122634 AC620000 */  sw        $v0, 0x0($v1)
/* B8D38 80122638 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8D3C 8012263C AC820000 */  sw        $v0, 0x0($a0)
/* B8D40 80122640 3C028015 */  lui       $v0, %hi(D_8014B988)
/* B8D44 80122644 2442B988 */  addiu     $v0, $v0, %lo(D_8014B988)
/* B8D48 80122648 08048A60 */  j         .L80122980
/* B8D4C 8012264C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122650
/* B8D50 80122650 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8D54 80122654 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8D58 80122658 8C620000 */  lw        $v0, 0x0($v1)
/* B8D5C 8012265C 0040202D */  daddu     $a0, $v0, $zero
/* B8D60 80122660 24420008 */  addiu     $v0, $v0, 0x8
/* B8D64 80122664 AC620000 */  sw        $v0, 0x0($v1)
/* B8D68 80122668 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8D6C 8012266C AC820000 */  sw        $v0, 0x0($a0)
/* B8D70 80122670 3C028015 */  lui       $v0, %hi(D_8014BA48)
/* B8D74 80122674 2442BA48 */  addiu     $v0, $v0, %lo(D_8014BA48)
/* B8D78 80122678 08048A60 */  j         .L80122980
/* B8D7C 8012267C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122680
/* B8D80 80122680 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8D84 80122684 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8D88 80122688 8C620000 */  lw        $v0, 0x0($v1)
/* B8D8C 8012268C 0040202D */  daddu     $a0, $v0, $zero
/* B8D90 80122690 24420008 */  addiu     $v0, $v0, 0x8
/* B8D94 80122694 AC620000 */  sw        $v0, 0x0($v1)
/* B8D98 80122698 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8D9C 8012269C AC820000 */  sw        $v0, 0x0($a0)
/* B8DA0 801226A0 3C028015 */  lui       $v0, %hi(D_8014BA70)
/* B8DA4 801226A4 2442BA70 */  addiu     $v0, $v0, %lo(D_8014BA70)
/* B8DA8 801226A8 08048A60 */  j         .L80122980
/* B8DAC 801226AC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801226B0
/* B8DB0 801226B0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8DB4 801226B4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8DB8 801226B8 8C620000 */  lw        $v0, 0x0($v1)
/* B8DBC 801226BC 0040202D */  daddu     $a0, $v0, $zero
/* B8DC0 801226C0 24420008 */  addiu     $v0, $v0, 0x8
/* B8DC4 801226C4 AC620000 */  sw        $v0, 0x0($v1)
/* B8DC8 801226C8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8DCC 801226CC AC820000 */  sw        $v0, 0x0($a0)
/* B8DD0 801226D0 3C028015 */  lui       $v0, %hi(D_8014BA98)
/* B8DD4 801226D4 2442BA98 */  addiu     $v0, $v0, %lo(D_8014BA98)
/* B8DD8 801226D8 08048A60 */  j         .L80122980
/* B8DDC 801226DC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801226E0
/* B8DE0 801226E0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8DE4 801226E4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8DE8 801226E8 8C620000 */  lw        $v0, 0x0($v1)
/* B8DEC 801226EC 0040202D */  daddu     $a0, $v0, $zero
/* B8DF0 801226F0 24420008 */  addiu     $v0, $v0, 0x8
/* B8DF4 801226F4 AC620000 */  sw        $v0, 0x0($v1)
/* B8DF8 801226F8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8DFC 801226FC AC820000 */  sw        $v0, 0x0($a0)
/* B8E00 80122700 3C028015 */  lui       $v0, %hi(D_8014BAE8)
/* B8E04 80122704 2442BAE8 */  addiu     $v0, $v0, %lo(D_8014BAE8)
/* B8E08 80122708 08048A60 */  j         .L80122980
/* B8E0C 8012270C AC820004 */   sw       $v0, 0x4($a0)
.L80122710:
/* B8E10 80122710 92420004 */  lbu       $v0, 0x4($s2)
/* B8E14 80122714 2442FFFF */  addiu     $v0, $v0, -0x1
/* B8E18 80122718 00021600 */  sll       $v0, $v0, 24
/* B8E1C 8012271C 00021E03 */  sra       $v1, $v0, 24
/* B8E20 80122720 2C620026 */  sltiu     $v0, $v1, 0x26
/* B8E24 80122724 10400059 */  beqz      $v0, .L8012288C
/* B8E28 80122728 00031080 */   sll      $v0, $v1, 2
/* B8E2C 8012272C 3C018015 */  lui       $at, %hi(jtbl_801502D8)
/* B8E30 80122730 00220821 */  addu      $at, $at, $v0
/* B8E34 80122734 8C2202D8 */  lw        $v0, %lo(jtbl_801502D8)($at)
/* B8E38 80122738 00400008 */  jr        $v0
/* B8E3C 8012273C 00000000 */   nop
glabel .L80122740
/* B8E40 80122740 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8E44 80122744 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8E48 80122748 8C620000 */  lw        $v0, 0x0($v1)
/* B8E4C 8012274C 0040202D */  daddu     $a0, $v0, $zero
/* B8E50 80122750 24420008 */  addiu     $v0, $v0, 0x8
/* B8E54 80122754 AC620000 */  sw        $v0, 0x0($v1)
/* B8E58 80122758 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8E5C 8012275C AC820000 */  sw        $v0, 0x0($a0)
/* B8E60 80122760 3C028015 */  lui       $v0, %hi(D_8014BE78)
/* B8E64 80122764 2442BE78 */  addiu     $v0, $v0, %lo(D_8014BE78)
/* B8E68 80122768 08048A23 */  j         .L8012288C
/* B8E6C 8012276C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122770
/* B8E70 80122770 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8E74 80122774 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8E78 80122778 8C620000 */  lw        $v0, 0x0($v1)
/* B8E7C 8012277C 0040202D */  daddu     $a0, $v0, $zero
/* B8E80 80122780 24420008 */  addiu     $v0, $v0, 0x8
/* B8E84 80122784 AC620000 */  sw        $v0, 0x0($v1)
/* B8E88 80122788 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8E8C 8012278C AC820000 */  sw        $v0, 0x0($a0)
/* B8E90 80122790 3C028015 */  lui       $v0, %hi(D_8014BEA0)
/* B8E94 80122794 2442BEA0 */  addiu     $v0, $v0, %lo(D_8014BEA0)
/* B8E98 80122798 08048A23 */  j         .L8012288C
/* B8E9C 8012279C AC820004 */   sw       $v0, 0x4($a0)
glabel .L801227A0
/* B8EA0 801227A0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8EA4 801227A4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8EA8 801227A8 8C620000 */  lw        $v0, 0x0($v1)
/* B8EAC 801227AC 0040202D */  daddu     $a0, $v0, $zero
/* B8EB0 801227B0 24420008 */  addiu     $v0, $v0, 0x8
/* B8EB4 801227B4 AC620000 */  sw        $v0, 0x0($v1)
/* B8EB8 801227B8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8EBC 801227BC AC820000 */  sw        $v0, 0x0($a0)
/* B8EC0 801227C0 3C028015 */  lui       $v0, %hi(D_8014BEC8)
/* B8EC4 801227C4 2442BEC8 */  addiu     $v0, $v0, %lo(D_8014BEC8)
/* B8EC8 801227C8 08048A23 */  j         .L8012288C
/* B8ECC 801227CC AC820004 */   sw       $v0, 0x4($a0)
glabel .L801227D0
/* B8ED0 801227D0 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8ED4 801227D4 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8ED8 801227D8 8C620000 */  lw        $v0, 0x0($v1)
/* B8EDC 801227DC 0040202D */  daddu     $a0, $v0, $zero
/* B8EE0 801227E0 24420008 */  addiu     $v0, $v0, 0x8
/* B8EE4 801227E4 AC620000 */  sw        $v0, 0x0($v1)
/* B8EE8 801227E8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8EEC 801227EC AC820000 */  sw        $v0, 0x0($a0)
/* B8EF0 801227F0 3C028015 */  lui       $v0, %hi(D_8014BEF0)
/* B8EF4 801227F4 2442BEF0 */  addiu     $v0, $v0, %lo(D_8014BEF0)
/* B8EF8 801227F8 08048A23 */  j         .L8012288C
/* B8EFC 801227FC AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122800
/* B8F00 80122800 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8F04 80122804 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8F08 80122808 8C620000 */  lw        $v0, 0x0($v1)
/* B8F0C 8012280C 0040202D */  daddu     $a0, $v0, $zero
/* B8F10 80122810 24420008 */  addiu     $v0, $v0, 0x8
/* B8F14 80122814 AC620000 */  sw        $v0, 0x0($v1)
/* B8F18 80122818 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8F1C 8012281C AC820000 */  sw        $v0, 0x0($a0)
/* B8F20 80122820 3C028015 */  lui       $v0, %hi(D_8014BF18)
/* B8F24 80122824 2442BF18 */  addiu     $v0, $v0, %lo(D_8014BF18)
/* B8F28 80122828 08048A23 */  j         .L8012288C
/* B8F2C 8012282C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122830
/* B8F30 80122830 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8F34 80122834 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8F38 80122838 8C620000 */  lw        $v0, 0x0($v1)
/* B8F3C 8012283C 0040202D */  daddu     $a0, $v0, $zero
/* B8F40 80122840 24420008 */  addiu     $v0, $v0, 0x8
/* B8F44 80122844 AC620000 */  sw        $v0, 0x0($v1)
/* B8F48 80122848 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8F4C 8012284C AC820000 */  sw        $v0, 0x0($a0)
/* B8F50 80122850 3C028015 */  lui       $v0, %hi(D_8014BF40)
/* B8F54 80122854 2442BF40 */  addiu     $v0, $v0, %lo(D_8014BF40)
/* B8F58 80122858 08048A23 */  j         .L8012288C
/* B8F5C 8012285C AC820004 */   sw       $v0, 0x4($a0)
glabel .L80122860
/* B8F60 80122860 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* B8F64 80122864 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* B8F68 80122868 8C620000 */  lw        $v0, 0x0($v1)
/* B8F6C 8012286C 0040202D */  daddu     $a0, $v0, $zero
/* B8F70 80122870 24420008 */  addiu     $v0, $v0, 0x8
/* B8F74 80122874 AC620000 */  sw        $v0, 0x0($v1)
/* B8F78 80122878 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B8F7C 8012287C AC820000 */  sw        $v0, 0x0($a0)
/* B8F80 80122880 3C028015 */  lui       $v0, %hi(D_8014BF68)
/* B8F84 80122884 2442BF68 */  addiu     $v0, $v0, %lo(D_8014BF68)
/* B8F88 80122888 AC820004 */  sw        $v0, 0x4($a0)
glabel .L8012288C
/* B8F8C 8012288C 3C070001 */  lui       $a3, (0x1F400 >> 16)
/* B8F90 80122890 3C028015 */  lui       $v0, %hi(entity_fog_dist_max)
/* B8F94 80122894 8C424390 */  lw        $v0, %lo(entity_fog_dist_max)($v0)
/* B8F98 80122898 3C038015 */  lui       $v1, %hi(entity_fog_dist_min)
/* B8F9C 8012289C 8C63438C */  lw        $v1, %lo(entity_fog_dist_min)($v1)
/* B8FA0 801228A0 34E7F400 */  ori       $a3, $a3, (0x1F400 & 0xFFFF)
/* B8FA4 801228A4 00431023 */  subu      $v0, $v0, $v1
/* B8FA8 801228A8 14400002 */  bnez      $v0, .L801228B4
/* B8FAC 801228AC 00E2001A */   div      $zero, $a3, $v0
/* B8FB0 801228B0 0007000D */  break     7
.L801228B4:
/* B8FB4 801228B4 2401FFFF */  addiu     $at, $zero, -0x1
/* B8FB8 801228B8 14410004 */  bne       $v0, $at, .L801228CC
/* B8FBC 801228BC 3C018000 */   lui      $at, (0x80000000 >> 16)
/* B8FC0 801228C0 14E10002 */  bne       $a3, $at, .L801228CC
/* B8FC4 801228C4 00000000 */   nop
/* B8FC8 801228C8 0006000D */  break     6
.L801228CC:
/* B8FCC 801228CC 00003812 */  mflo      $a3
/* B8FD0 801228D0 240501F4 */  addiu     $a1, $zero, 0x1F4
/* B8FD4 801228D4 00A32823 */  subu      $a1, $a1, $v1
/* B8FD8 801228D8 00052A00 */  sll       $a1, $a1, 8
/* B8FDC 801228DC 14400002 */  bnez      $v0, .L801228E8
/* B8FE0 801228E0 00A2001A */   div      $zero, $a1, $v0
/* B8FE4 801228E4 0007000D */  break     7
.L801228E8:
/* B8FE8 801228E8 2401FFFF */  addiu     $at, $zero, -0x1
/* B8FEC 801228EC 14410004 */  bne       $v0, $at, .L80122900
/* B8FF0 801228F0 3C018000 */   lui      $at, (0x80000000 >> 16)
/* B8FF4 801228F4 14A10002 */  bne       $a1, $at, .L80122900
/* B8FF8 801228F8 00000000 */   nop
/* B8FFC 801228FC 0006000D */  break     6
.L80122900:
/* B9000 80122900 00002812 */  mflo      $a1
/* B9004 80122904 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* B9008 80122908 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* B900C 8012290C 8D060000 */  lw        $a2, 0x0($t0)
/* B9010 80122910 00C0482D */  daddu     $t1, $a2, $zero
/* B9014 80122914 24C60008 */  addiu     $a2, $a2, 0x8
/* B9018 80122918 3C02F800 */  lui       $v0, (0xF8000000 >> 16)
/* B901C 8012291C AD060000 */  sw        $a2, 0x0($t0)
/* B9020 80122920 AD220000 */  sw        $v0, 0x0($t1)
/* B9024 80122924 3C028015 */  lui       $v0, %hi(D_8015437F)
/* B9028 80122928 9042437F */  lbu       $v0, %lo(D_8015437F)($v0)
/* B902C 8012292C 3C038015 */  lui       $v1, %hi(D_80154383)
/* B9030 80122930 90634383 */  lbu       $v1, %lo(D_80154383)($v1)
/* B9034 80122934 3C048015 */  lui       $a0, %hi(D_80154387)
/* B9038 80122938 90844387 */  lbu       $a0, %lo(D_80154387)($a0)
/* B903C 8012293C 00021600 */  sll       $v0, $v0, 24
/* B9040 80122940 00031C00 */  sll       $v1, $v1, 16
/* B9044 80122944 00431025 */  or        $v0, $v0, $v1
/* B9048 80122948 00042200 */  sll       $a0, $a0, 8
/* B904C 8012294C 3C038015 */  lui       $v1, %hi(D_8015438B)
/* B9050 80122950 9063438B */  lbu       $v1, %lo(D_8015438B)($v1)
/* B9054 80122954 00441025 */  or        $v0, $v0, $a0
/* B9058 80122958 00431025 */  or        $v0, $v0, $v1
/* B905C 8012295C AD220004 */  sw        $v0, 0x4($t1)
/* B9060 80122960 24C20008 */  addiu     $v0, $a2, 0x8
/* B9064 80122964 AD020000 */  sw        $v0, 0x0($t0)
/* B9068 80122968 3C02DB08 */  lui       $v0, (0xDB080000 >> 16)
/* B906C 8012296C ACC20000 */  sw        $v0, 0x0($a2)
/* B9070 80122970 00073C00 */  sll       $a3, $a3, 16
/* B9074 80122974 30A5FFFF */  andi      $a1, $a1, 0xFFFF
/* B9078 80122978 00E53825 */  or        $a3, $a3, $a1
/* B907C 8012297C ACC70004 */  sw        $a3, 0x4($a2)
glabel .L80122980
/* B9080 80122980 3C02D9FD */  lui       $v0, (0xD9FDFFFF >> 16)
.L80122984:
/* B9084 80122984 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* B9088 80122988 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* B908C 8012298C 3442FFFF */  ori       $v0, $v0, (0xD9FDFFFF & 0xFFFF)
/* B9090 80122990 8CC50000 */  lw        $a1, 0x0($a2)
/* B9094 80122994 3C048015 */  lui       $a0, %hi(entity_fog_enabled)
/* B9098 80122998 8C844378 */  lw        $a0, %lo(entity_fog_enabled)($a0)
/* B909C 8012299C 00A0182D */  daddu     $v1, $a1, $zero
/* B90A0 801229A0 24A50008 */  addiu     $a1, $a1, 0x8
/* B90A4 801229A4 ACC50000 */  sw        $a1, 0x0($a2)
/* B90A8 801229A8 AC620000 */  sw        $v0, 0x0($v1)
/* B90AC 801229AC 10800005 */  beqz      $a0, .L801229C4
/* B90B0 801229B0 AC600004 */   sw       $zero, 0x4($v1)
/* B90B4 801229B4 8E420000 */  lw        $v0, 0x0($s2)
/* B90B8 801229B8 30420800 */  andi      $v0, $v0, 0x800
/* B90BC 801229BC 1040000A */  beqz      $v0, .L801229E8
/* B90C0 801229C0 3C02FC12 */   lui      $v0, (0xFC121E04 >> 16)
.L801229C4:
/* B90C4 801229C4 3C04FC12 */  lui       $a0, (0xFC121824 >> 16)
/* B90C8 801229C8 34841824 */  ori       $a0, $a0, (0xFC121824 & 0xFFFF)
/* B90CC 801229CC 3C03FF33 */  lui       $v1, (0xFF33FFFF >> 16)
/* B90D0 801229D0 3463FFFF */  ori       $v1, $v1, (0xFF33FFFF & 0xFFFF)
/* B90D4 801229D4 24A20008 */  addiu     $v0, $a1, 0x8
/* B90D8 801229D8 ACC20000 */  sw        $v0, 0x0($a2)
/* B90DC 801229DC ACA40000 */  sw        $a0, 0x0($a1)
/* B90E0 801229E0 08048A80 */  j         .L80122A00
/* B90E4 801229E4 ACA30004 */   sw       $v1, 0x4($a1)
.L801229E8:
/* B90E8 801229E8 34421E04 */  ori       $v0, $v0, (0xFC121E04 & 0xFFFF)
/* B90EC 801229EC 24A30008 */  addiu     $v1, $a1, 0x8
/* B90F0 801229F0 ACC30000 */  sw        $v1, 0x0($a2)
/* B90F4 801229F4 ACA20000 */  sw        $v0, 0x0($a1)
/* B90F8 801229F8 2402F3F8 */  addiu     $v0, $zero, -0xC08
/* B90FC 801229FC ACA20004 */  sw        $v0, 0x4($a1)
.L80122A00:
/* B9100 80122A00 8E42005C */  lw        $v0, 0x5C($s2)
/* B9104 80122A04 10400012 */  beqz      $v0, .L80122A50
/* B9108 80122A08 3C07D838 */   lui      $a3, (0xD8380002 >> 16)
/* B910C 80122A0C 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* B9110 80122A10 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* B9114 80122A14 8C830000 */  lw        $v1, 0x0($a0)
/* B9118 80122A18 3C028015 */  lui       $v0, %hi(D_80154374)
/* B911C 80122A1C 8C424374 */  lw        $v0, %lo(D_80154374)($v0)
/* B9120 80122A20 0060282D */  daddu     $a1, $v1, $zero
/* B9124 80122A24 24630008 */  addiu     $v1, $v1, 0x8
/* B9128 80122A28 00021080 */  sll       $v0, $v0, 2
/* B912C 80122A2C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* B9130 80122A30 AC830000 */  sw        $v1, 0x0($a0)
/* B9134 80122A34 3C03DB06 */  lui       $v1, (0xDB060000 >> 16)
/* B9138 80122A38 00431025 */  or        $v0, $v0, $v1
/* B913C 80122A3C ACA20000 */  sw        $v0, 0x0($a1)
/* B9140 80122A40 8E42005C */  lw        $v0, 0x5C($s2)
/* B9144 80122A44 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* B9148 80122A48 00431021 */  addu      $v0, $v0, $v1
/* B914C 80122A4C ACA20004 */  sw        $v0, 0x4($a1)
.L80122A50:
/* B9150 80122A50 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* B9154 80122A54 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* B9158 80122A58 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* B915C 80122A5C 8CA20000 */  lw        $v0, 0x0($a1)
/* B9160 80122A60 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* B9164 80122A64 0040302D */  daddu     $a2, $v0, $zero
/* B9168 80122A68 24420008 */  addiu     $v0, $v0, 0x8
/* B916C 80122A6C ACA20000 */  sw        $v0, 0x0($a1)
/* B9170 80122A70 ACC30000 */  sw        $v1, 0x0($a2)
/* B9174 80122A74 8E440014 */  lw        $a0, 0x14($s2)
/* B9178 80122A78 24430008 */  addiu     $v1, $v0, 0x8
/* B917C 80122A7C ACA30000 */  sw        $v1, 0x0($a1)
/* B9180 80122A80 24030040 */  addiu     $v1, $zero, 0x40
/* B9184 80122A84 ACC40004 */  sw        $a0, 0x4($a2)
/* B9188 80122A88 AC430004 */  sw        $v1, 0x4($v0)
/* B918C 80122A8C 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* B9190 80122A90 AC470000 */  sw        $a3, 0x0($v0)
/* B9194 80122A94 AC430008 */  sw        $v1, 0x8($v0)
/* B9198 80122A98 AC40000C */  sw        $zero, 0xC($v0)
/* B919C 80122A9C 8E430000 */  lw        $v1, 0x0($s2)
/* B91A0 80122AA0 24420010 */  addiu     $v0, $v0, 0x10
/* B91A4 80122AA4 30630200 */  andi      $v1, $v1, 0x200
/* B91A8 80122AA8 106000AE */  beqz      $v1, .L80122D64
/* B91AC 80122AAC ACA20000 */   sw       $v0, 0x0($a1)
/* B91B0 80122AB0 27A40010 */  addiu     $a0, $sp, 0x10
/* B91B4 80122AB4 26510018 */  addiu     $s1, $s2, 0x18
/* B91B8 80122AB8 0C019D60 */  jal       guMtxL2F
/* B91BC 80122ABC 0220282D */   daddu    $a1, $s1, $zero
/* B91C0 80122AC0 27B00050 */  addiu     $s0, $sp, 0x50
/* B91C4 80122AC4 0C048450 */  jal       make_entity_model_mtx_flipZ
/* B91C8 80122AC8 0200202D */   daddu    $a0, $s0, $zero
/* B91CC 80122ACC 27A40010 */  addiu     $a0, $sp, 0x10
/* B91D0 80122AD0 0200282D */  daddu     $a1, $s0, $zero
/* B91D4 80122AD4 0C019D80 */  jal       guMtxCatF
/* B91D8 80122AD8 0080302D */   daddu    $a2, $a0, $zero
/* B91DC 80122ADC 27A40010 */  addiu     $a0, $sp, 0x10
/* B91E0 80122AE0 0C019D40 */  jal       guMtxF2L
/* B91E4 80122AE4 0220282D */   daddu    $a1, $s1, $zero
/* B91E8 80122AE8 3C040001 */  lui       $a0, (0x11630 >> 16)
/* B91EC 80122AEC 34841630 */  ori       $a0, $a0, (0x11630 & 0xFFFF)
/* B91F0 80122AF0 26450058 */  addiu     $a1, $s2, 0x58
/* B91F4 80122AF4 3C028007 */  lui       $v0, %hi(gMatrixListPos)
/* B91F8 80122AF8 944241F0 */  lhu       $v0, %lo(gMatrixListPos)($v0)
/* B91FC 80122AFC 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* B9200 80122B00 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* B9204 80122B04 00021180 */  sll       $v0, $v0, 6
/* B9208 80122B08 00621821 */  addu      $v1, $v1, $v0
/* B920C 80122B0C 00641821 */  addu      $v1, $v1, $a0
.L80122B10:
/* B9210 80122B10 8E2E0000 */  lw        $t6, 0x0($s1)
/* B9214 80122B14 8E2F0004 */  lw        $t7, 0x4($s1)
/* B9218 80122B18 8E380008 */  lw        $t8, 0x8($s1)
/* B921C 80122B1C 8E39000C */  lw        $t9, 0xC($s1)
/* B9220 80122B20 AC6E0000 */  sw        $t6, 0x0($v1)
/* B9224 80122B24 AC6F0004 */  sw        $t7, 0x4($v1)
/* B9228 80122B28 AC780008 */  sw        $t8, 0x8($v1)
/* B922C 80122B2C AC79000C */  sw        $t9, 0xC($v1)
/* B9230 80122B30 26310010 */  addiu     $s1, $s1, 0x10
/* B9234 80122B34 1625FFF6 */  bne       $s1, $a1, .L80122B10
/* B9238 80122B38 24630010 */   addiu    $v1, $v1, 0x10
/* B923C 80122B3C 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* B9240 80122B40 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* B9244 80122B44 3C080001 */  lui       $t0, (0x11630 >> 16)
/* B9248 80122B48 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* B924C 80122B4C 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* B9250 80122B50 35081630 */  ori       $t0, $t0, (0x11630 & 0xFFFF)
/* B9254 80122B54 3C058007 */  lui       $a1, %hi(gMatrixListPos)
/* B9258 80122B58 24A541F0 */  addiu     $a1, $a1, %lo(gMatrixListPos)
/* B925C 80122B5C 8CC40000 */  lw        $a0, 0x0($a2)
/* B9260 80122B60 94A20000 */  lhu       $v0, 0x0($a1)
/* B9264 80122B64 0080382D */  daddu     $a3, $a0, $zero
/* B9268 80122B68 24840008 */  addiu     $a0, $a0, 0x8
/* B926C 80122B6C ACC40000 */  sw        $a0, 0x0($a2)
/* B9270 80122B70 ACE30000 */  sw        $v1, 0x0($a3)
/* B9274 80122B74 24430001 */  addiu     $v1, $v0, 0x1
/* B9278 80122B78 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* B927C 80122B7C 00021180 */  sll       $v0, $v0, 6
/* B9280 80122B80 A4A30000 */  sh        $v1, 0x0($a1)
/* B9284 80122B84 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* B9288 80122B88 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* B928C 80122B8C 00481021 */  addu      $v0, $v0, $t0
/* B9290 80122B90 00621821 */  addu      $v1, $v1, $v0
/* B9294 80122B94 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* B9298 80122B98 ACE30004 */  sw        $v1, 0x4($a3)
/* B929C 80122B9C AC820000 */  sw        $v0, 0x0($a0)
/* B92A0 80122BA0 8E430014 */  lw        $v1, 0x14($s2)
/* B92A4 80122BA4 24820008 */  addiu     $v0, $a0, 0x8
/* B92A8 80122BA8 ACC20000 */  sw        $v0, 0x0($a2)
/* B92AC 80122BAC 08048B49 */  j         .L80122D24
/* B92B0 80122BB0 AC830004 */   sw       $v1, 0x4($a0)
.L80122BB4:
/* B92B4 80122BB4 3C03D9C0 */  lui       $v1, (0xD9C0F9FA >> 16)
/* B92B8 80122BB8 3463F9FA */  ori       $v1, $v1, (0xD9C0F9FA & 0xFFFF)
/* B92BC 80122BBC 3C05D9FF */  lui       $a1, (0xD9FFFFFF >> 16)
/* B92C0 80122BC0 34A5FFFF */  ori       $a1, $a1, (0xD9FFFFFF & 0xFFFF)
/* B92C4 80122BC4 3C040022 */  lui       $a0, (0x220005 >> 16)
/* B92C8 80122BC8 34840005 */  ori       $a0, $a0, (0x220005 & 0xFFFF)
/* B92CC 80122BCC 3C06DC08 */  lui       $a2, (0xDC08060A >> 16)
/* B92D0 80122BD0 34C6060A */  ori       $a2, $a2, (0xDC08060A & 0xFFFF)
/* B92D4 80122BD4 3C07DC08 */  lui       $a3, (0xDC08090A >> 16)
/* B92D8 80122BD8 34E7090A */  ori       $a3, $a3, (0xDC08090A & 0xFFFF)
/* B92DC 80122BDC 3C08D700 */  lui       $t0, (0xD7000002 >> 16)
/* B92E0 80122BE0 35080002 */  ori       $t0, $t0, (0xD7000002 & 0xFFFF)
/* B92E4 80122BE4 3C0AE200 */  lui       $t2, (0xE2001E01 >> 16)
/* B92E8 80122BE8 354A1E01 */  ori       $t2, $t2, (0xE2001E01 & 0xFFFF)
/* B92EC 80122BEC 3C0BE300 */  lui       $t3, (0xE3000A11 >> 16)
/* B92F0 80122BF0 356B0A11 */  ori       $t3, $t3, (0xE3000A11 & 0xFFFF)
/* B92F4 80122BF4 3C090008 */  lui       $t1, (0x82CF0 >> 16)
/* B92F8 80122BF8 35292CF0 */  ori       $t1, $t1, (0x82CF0 & 0xFFFF)
/* B92FC 80122BFC 25820008 */  addiu     $v0, $t4, 0x8
/* B9300 80122C00 ADA20000 */  sw        $v0, 0x0($t5)
/* B9304 80122C04 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* B9308 80122C08 AD820000 */  sw        $v0, 0x0($t4)
/* B930C 80122C0C 25820010 */  addiu     $v0, $t4, 0x10
/* B9310 80122C10 AD800004 */  sw        $zero, 0x4($t4)
/* B9314 80122C14 ADA20000 */  sw        $v0, 0x0($t5)
/* B9318 80122C18 25820018 */  addiu     $v0, $t4, 0x18
/* B931C 80122C1C AD830008 */  sw        $v1, 0x8($t4)
/* B9320 80122C20 AD80000C */  sw        $zero, 0xC($t4)
/* B9324 80122C24 ADA20000 */  sw        $v0, 0x0($t5)
/* B9328 80122C28 25820020 */  addiu     $v0, $t4, 0x20
/* B932C 80122C2C AD850010 */  sw        $a1, 0x10($t4)
/* B9330 80122C30 AD840014 */  sw        $a0, 0x14($t4)
/* B9334 80122C34 ADA20000 */  sw        $v0, 0x0($t5)
/* B9338 80122C38 3C02DB02 */  lui       $v0, (0xDB020000 >> 16)
/* B933C 80122C3C AD820018 */  sw        $v0, 0x18($t4)
/* B9340 80122C40 24020018 */  addiu     $v0, $zero, 0x18
/* B9344 80122C44 AD82001C */  sw        $v0, 0x1C($t4)
/* B9348 80122C48 25820028 */  addiu     $v0, $t4, 0x28
/* B934C 80122C4C ADA20000 */  sw        $v0, 0x0($t5)
/* B9350 80122C50 3C028015 */  lui       $v0, %hi(D_8014C270)
/* B9354 80122C54 2442C270 */  addiu     $v0, $v0, %lo(D_8014C270)
/* B9358 80122C58 AD820024 */  sw        $v0, 0x24($t4)
/* B935C 80122C5C 2442FFF8 */  addiu     $v0, $v0, -0x8
/* B9360 80122C60 AD82002C */  sw        $v0, 0x2C($t4)
/* B9364 80122C64 2402FFFF */  addiu     $v0, $zero, -0x1
/* B9368 80122C68 AD860020 */  sw        $a2, 0x20($t4)
/* B936C 80122C6C AD870028 */  sw        $a3, 0x28($t4)
/* B9370 80122C70 AD880030 */  sw        $t0, 0x30($t4)
/* B9374 80122C74 AD820034 */  sw        $v0, 0x34($t4)
/* B9378 80122C78 AD8A0038 */  sw        $t2, 0x38($t4)
/* B937C 80122C7C AD80003C */  sw        $zero, 0x3C($t4)
/* B9380 80122C80 AD8B0040 */  sw        $t3, 0x40($t4)
/* B9384 80122C84 AD890044 */  sw        $t1, 0x44($t4)
/* B9388 80122C88 8E460014 */  lw        $a2, 0x14($s2)
/* B938C 80122C8C 25820030 */  addiu     $v0, $t4, 0x30
/* B9390 80122C90 ADA20000 */  sw        $v0, 0x0($t5)
/* B9394 80122C94 25820038 */  addiu     $v0, $t4, 0x38
/* B9398 80122C98 8CC30000 */  lw        $v1, 0x0($a2)
/* B939C 80122C9C 27B000A8 */  addiu     $s0, $sp, 0xA8
/* B93A0 80122CA0 ADA20000 */  sw        $v0, 0x0($t5)
/* B93A4 80122CA4 AFA30090 */  sw        $v1, 0x90($sp)
/* B93A8 80122CA8 8CC30004 */  lw        $v1, 0x4($a2)
/* B93AC 80122CAC 25820040 */  addiu     $v0, $t4, 0x40
/* B93B0 80122CB0 ADA20000 */  sw        $v0, 0x0($t5)
/* B93B4 80122CB4 AFA30094 */  sw        $v1, 0x94($sp)
/* B93B8 80122CB8 94C3000A */  lhu       $v1, 0xA($a2)
/* B93BC 80122CBC 25820048 */  addiu     $v0, $t4, 0x48
/* B93C0 80122CC0 ADA20000 */  sw        $v0, 0x0($t5)
/* B93C4 80122CC4 A7A30098 */  sh        $v1, 0x98($sp)
/* B93C8 80122CC8 94C2000E */  lhu       $v0, 0xE($a2)
/* B93CC 80122CCC 0200202D */  daddu     $a0, $s0, $zero
/* B93D0 80122CD0 A7A2009A */  sh        $v0, 0x9A($sp)
/* B93D4 80122CD4 8CC20008 */  lw        $v0, 0x8($a2)
/* B93D8 80122CD8 26450018 */  addiu     $a1, $s2, 0x18
/* B93DC 80122CDC 00021023 */  negu      $v0, $v0
/* B93E0 80122CE0 00021FC2 */  srl       $v1, $v0, 31
/* B93E4 80122CE4 00431021 */  addu      $v0, $v0, $v1
/* B93E8 80122CE8 00021043 */  sra       $v0, $v0, 1
/* B93EC 80122CEC A7A2009C */  sh        $v0, 0x9C($sp)
/* B93F0 80122CF0 8CC2000C */  lw        $v0, 0xC($a2)
/* B93F4 80122CF4 240300FF */  addiu     $v1, $zero, 0xFF
/* B93F8 80122CF8 A3A300A0 */  sb        $v1, 0xA0($sp)
/* B93FC 80122CFC 00021FC2 */  srl       $v1, $v0, 31
/* B9400 80122D00 00431021 */  addu      $v0, $v0, $v1
/* B9404 80122D04 00021043 */  sra       $v0, $v0, 1
/* B9408 80122D08 0C019D60 */  jal       guMtxL2F
/* B940C 80122D0C A7A2009E */   sh       $v0, 0x9E($sp)
/* B9410 80122D10 0000202D */  daddu     $a0, $zero, $zero
/* B9414 80122D14 27A50090 */  addiu     $a1, $sp, 0x90
/* B9418 80122D18 0080302D */  daddu     $a2, $a0, $zero
/* B941C 80122D1C 0C04EBDC */  jal       imgfx_appendGfx_component
/* B9420 80122D20 0200382D */   daddu    $a3, $s0, $zero
.L80122D24:
/* B9424 80122D24 3C03D838 */  lui       $v1, (0xD8380002 >> 16)
/* B9428 80122D28 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* B942C 80122D2C 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* B9430 80122D30 8C820000 */  lw        $v0, 0x0($a0)
/* B9434 80122D34 34630002 */  ori       $v1, $v1, (0xD8380002 & 0xFFFF)
/* B9438 80122D38 0040282D */  daddu     $a1, $v0, $zero
/* B943C 80122D3C 24420008 */  addiu     $v0, $v0, 0x8
/* B9440 80122D40 AC820000 */  sw        $v0, 0x0($a0)
/* B9444 80122D44 ACA30000 */  sw        $v1, 0x0($a1)
/* B9448 80122D48 24030040 */  addiu     $v1, $zero, 0x40
/* B944C 80122D4C ACA30004 */  sw        $v1, 0x4($a1)
/* B9450 80122D50 24430008 */  addiu     $v1, $v0, 0x8
/* B9454 80122D54 AC830000 */  sw        $v1, 0x0($a0)
/* B9458 80122D58 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* B945C 80122D5C AC430000 */  sw        $v1, 0x0($v0)
/* B9460 80122D60 AC400004 */  sw        $zero, 0x4($v0)
.L80122D64:
/* B9464 80122D64 8FBF00F4 */  lw        $ra, 0xF4($sp)
/* B9468 80122D68 8FB200F0 */  lw        $s2, 0xF0($sp)
/* B946C 80122D6C 8FB100EC */  lw        $s1, 0xEC($sp)
/* B9470 80122D70 8FB000E8 */  lw        $s0, 0xE8($sp)
/* B9474 80122D74 03E00008 */  jr        $ra
/* B9478 80122D78 27BD00F8 */   addiu    $sp, $sp, 0xF8

### DECOMPILED C INSTRUCTIONS:

void draw_entity_model_E(s32 modelIdx, Mtx* transformMtx) {
    EntityModel* model = (*gCurrentEntityModelList)[modelIdx & ~0x800];
    Matrix4f mtx;
    Matrix4f mtx2;
    ImgFXTexture ifxImg;
    Matrix4f imgfxMtx;

    if (model == NULL) {
        return;
    }
    if (model->flags == 0) {
        return;
    }
    if (model->flags & ENTITY_MODEL_FLAG_100) {
        return;
    }
    if (model->flags & ENTITY_MODEL_FLAG_HIDDEN) {
        return;
    }
    if (model->flags & ENTITY_MODEL_FLAG_40) {
        return;
    }
    if (!(model->flags & ENTITY_MODEL_FLAG_CAM3)) {
        return;
    }

    model->transform = *transformMtx;
    model->vertexArray = NULL;
    gDisplayContext->matrixStack[gMatrixListPos] = model->transform;
    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    if (!(model->flags & ENTITY_MODEL_FLAG_USE_IMAGE)) {
        s32 cond = FALSE;
        if (entity_fog_enabled && !(model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) {
            cond = TRUE;
        }
        switch (cond) {
            case FALSE:
                switch (model->renderMode) {
                    case RENDER_MODE_SURFACE_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014B7F8);
                        break;
                    case RENDER_MODE_DECAL_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014B820);
                        break;
                    case RENDER_MODE_INTERSECTING_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014B848);
                        break;
                    case RENDER_MODE_ALPHATEST:
                        gSPDisplayList(gMainGfxPos++, D_8014B870);
                        break;
                    case RENDER_MODE_SURFACE_XLU_LAYER1:
                    case RENDER_MODE_SURFACE_XLU_LAYER2:
                    case RENDER_MODE_SURFACE_XLU_LAYER3:
                        gSPDisplayList(gMainGfxPos++, D_8014B898);
                        break;
                    case RENDER_MODE_SURFACE_XLU_NO_AA:
                        gSPDisplayList(gMainGfxPos++, D_8014B9B0);
                        break;
                    case RENDER_MODE_DECAL_XLU:
                    case RENDER_MODE_1E:
                        gSPDisplayList(gMainGfxPos++, D_8014B8C0);
                        break;
                    case RENDER_MODE_DECAL_XLU_NOAA:
                    case RENDER_MODE_SHADOW:
                        gSPDisplayList(gMainGfxPos++, D_8014B9D8);
                        break;
                    case RENDER_MODE_INTERSECTING_XLU:
                        gSPDisplayList(gMainGfxPos++, D_8014B8E8);
                        break;
                    case RENDER_MODE_28:
                        gSPDisplayList(gMainGfxPos++, D_8014BA00);
                        break;
                    case RENDER_MODE_ALPHATEST_ONESIDED:
                        gSPDisplayList(gMainGfxPos++, D_8014B988);
                        break;
                    case RENDER_MODE_SURFACE_OPA_NO_ZB:
                    case RENDER_MODE_2A:
                        gSPDisplayList(gMainGfxPos++, D_8014BA48);
                        break;
                    case RENDER_MODE_ALPHATEST_NO_ZB:
                    case RENDER_MODE_2B:
                        gSPDisplayList(gMainGfxPos++, D_8014BA70);
                        break;
                    case RENDER_MODE_SURFACE_XLU_NO_ZB:
                    case RENDER_MODE_2C:
                        gSPDisplayList(gMainGfxPos++, D_8014BA98);
                        break;
                    case RENDER_MODE_2D:
                        gSPDisplayList(gMainGfxPos++, D_8014BAE8);
                        break;
                }
                break;
            case TRUE:
                switch (model->renderMode) {
                    case RENDER_MODE_SURFACE_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014BE78);
                        break;
                    case RENDER_MODE_DECAL_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014BEA0);
                        break;
                    case RENDER_MODE_INTERSECTING_OPA:
                        gSPDisplayList(gMainGfxPos++, D_8014BEC8);
                        break;
                    case RENDER_MODE_ALPHATEST:
                        gSPDisplayList(gMainGfxPos++, D_8014BEF0);
                        break;
                    case RENDER_MODE_SURFACE_XLU_LAYER1:
                        gSPDisplayList(gMainGfxPos++, D_8014BF18);
                        break;
                    case RENDER_MODE_DECAL_XLU:
                        gSPDisplayList(gMainGfxPos++, D_8014BF40);
                        break;
                    case RENDER_MODE_INTERSECTING_XLU:
                        gSPDisplayList(gMainGfxPos++, D_8014BF68);
                        break;
                }
                gDPSetFogColor(gMainGfxPos++, entity_fog_red, entity_fog_green, entity_fog_blue, entity_fog_alpha);
                gSPFogPosition(gMainGfxPos++, entity_fog_dist_min, entity_fog_dist_max);
                break;
        }
        gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
        if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) {
            gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
        } else {
            gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED);
        }
        if (model->vertexArray != NULL) {
            gSPSegment(gMainGfxPos++, D_80154374, VIRTUAL_TO_PHYSICAL(model->vertexArray));
        }
        gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
        gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        gDPPipeSync(gMainGfxPos++);
        if (!(model->flags & ENTITY_MODEL_FLAG_REFLECT)) {
            return;
        }

        guMtxL2F(mtx, &model->transform);
        make_entity_model_mtx_flipZ(mtx2);
        guMtxCatF(mtx, mtx2, mtx);
        guMtxF2L(mtx, &model->transform);
        gDisplayContext->matrixStack[gMatrixListPos] = model->transform;
        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
        gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
    } else {
        SpriteRasterInfo* imageData;

        gDPPipeSync(gMainGfxPos++);
        gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
        gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
        gSPSetLights1(gMainGfxPos++, D_8014C268);
        gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
        gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
        gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE);

        imageData = model->gfx.imageData;
        ifxImg.raster = imageData->raster;
        ifxImg.palette = imageData->defaultPal;
        ifxImg.width = imageData->width;
        ifxImg.height = imageData->height;
        ifxImg.xOffset = -imageData->width / 2;
        ifxImg.yOffset = imageData->height / 2;
        ifxImg.alpha = 255;
        guMtxL2F(imgfxMtx, &model->transform);
        imgfx_appendGfx_component(0, &ifxImg, 0, imgfxMtx);
    }

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


### RAW ASSEMBLY INSTRUCTIONS:

glabel imgfx_mesh_anim_update
/* D2AF0 8013C3F0 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* D2AF4 8013C3F4 AFB20020 */  sw        $s2, 0x20($sp)
/* D2AF8 8013C3F8 0080902D */  daddu     $s2, $a0, $zero
/* D2AFC 8013C3FC AFB70034 */  sw        $s7, 0x34($sp)
/* D2B00 8013C400 0000B82D */  daddu     $s7, $zero, $zero
/* D2B04 8013C404 AFBF003C */  sw        $ra, 0x3C($sp)
/* D2B08 8013C408 AFBE0038 */  sw        $fp, 0x38($sp)
/* D2B0C 8013C40C AFB60030 */  sw        $s6, 0x30($sp)
/* D2B10 8013C410 AFB5002C */  sw        $s5, 0x2C($sp)
/* D2B14 8013C414 AFB40028 */  sw        $s4, 0x28($sp)
/* D2B18 8013C418 AFB30024 */  sw        $s3, 0x24($sp)
/* D2B1C 8013C41C AFB1001C */  sw        $s1, 0x1C($sp)
/* D2B20 8013C420 AFB00018 */  sw        $s0, 0x18($sp)
/* D2B24 8013C424 C640003C */  lwc1      $f0, 0x3C($s2)
/* D2B28 8013C428 8E540020 */  lw        $s4, 0x20($s2)
/* D2B2C 8013C42C 4600028D */  trunc.w.s $f10, $f0
/* D2B30 8013C430 44165000 */  mfc1      $s6, $f10
/* D2B34 8013C434 8E4D0024 */  lw        $t5, 0x24($s2)
/* D2B38 8013C438 0C04F088 */  jal       imgfx_load_anim
/* D2B3C 8013C43C AFAD0014 */   sw       $t5, 0x14($sp)
/* D2B40 8013C440 0040982D */  daddu     $s3, $v0, $zero
/* D2B44 8013C444 126002CC */  beqz      $s3, .L8013CF78
/* D2B48 8013C448 00000000 */   nop
/* D2B4C 8013C44C 8E430014 */  lw        $v1, 0x14($s2)
/* D2B50 8013C450 30620200 */  andi      $v0, $v1, 0x200
/* D2B54 8013C454 1040000C */  beqz      $v0, .L8013C488
/* D2B58 8013C458 2402FDFF */   addiu    $v0, $zero, -0x201
/* D2B5C 8013C45C 00621024 */  and       $v0, $v1, $v0
/* D2B60 8013C460 AE420014 */  sw        $v0, 0x14($s2)
/* D2B64 8013C464 30620100 */  andi      $v0, $v1, 0x100
/* D2B68 8013C468 10400007 */  beqz      $v0, .L8013C488
/* D2B6C 8013C46C 00000000 */   nop
/* D2B70 8013C470 9662000C */  lhu       $v0, 0xC($s3)
/* D2B74 8013C474 2442FFFF */  addiu     $v0, $v0, -0x1
/* D2B78 8013C478 44820000 */  mtc1      $v0, $f0
/* D2B7C 8013C47C 00000000 */  nop
/* D2B80 8013C480 46800020 */  cvt.s.w   $f0, $f0
/* D2B84 8013C484 E6400040 */  swc1      $f0, 0x40($s2)
.L8013C488:
/* D2B88 8013C488 C6400040 */  lwc1      $f0, 0x40($s2)
/* D2B8C 8013C48C 8E430014 */  lw        $v1, 0x14($s2)
/* D2B90 8013C490 4600028D */  trunc.w.s $f10, $f0
/* D2B94 8013C494 44115000 */  mfc1      $s1, $f10
/* D2B98 8013C498 06810002 */  bgez      $s4, .L8013C4A4
/* D2B9C 8013C49C 0280682D */   daddu    $t5, $s4, $zero
/* D2BA0 8013C4A0 000D6823 */  negu      $t5, $t5
.L8013C4A4:
/* D2BA4 8013C4A4 30624000 */  andi      $v0, $v1, 0x4000
/* D2BA8 8013C4A8 10400003 */  beqz      $v0, .L8013C4B8
/* D2BAC 8013C4AC AFAD0010 */   sw       $t5, 0x10($sp)
/* D2BB0 8013C4B0 0804F13F */  j         .L8013C4FC
/* D2BB4 8013C4B4 0220802D */   daddu    $s0, $s1, $zero
.L8013C4B8:
/* D2BB8 8013C4B8 30620100 */  andi      $v0, $v1, 0x100
/* D2BBC 8013C4BC 10400008 */  beqz      $v0, .L8013C4E0
/* D2BC0 8013C4C0 2630FFFF */   addiu    $s0, $s1, -0x1
/* D2BC4 8013C4C4 0601000D */  bgez      $s0, .L8013C4FC
/* D2BC8 8013C4C8 30620080 */   andi     $v0, $v1, 0x80
/* D2BCC 8013C4CC 1040000B */  beqz      $v0, .L8013C4FC
/* D2BD0 8013C4D0 0220802D */   daddu    $s0, $s1, $zero
/* D2BD4 8013C4D4 9662000C */  lhu       $v0, 0xC($s3)
/* D2BD8 8013C4D8 0804F13F */  j         .L8013C4FC
/* D2BDC 8013C4DC 2450FFFF */   addiu    $s0, $v0, -0x1
.L8013C4E0:
/* D2BE0 8013C4E0 9662000C */  lhu       $v0, 0xC($s3)
/* D2BE4 8013C4E4 26300001 */  addiu     $s0, $s1, 0x1
/* D2BE8 8013C4E8 16020004 */  bne       $s0, $v0, .L8013C4FC
/* D2BEC 8013C4EC 30620080 */   andi     $v0, $v1, 0x80
/* D2BF0 8013C4F0 10400002 */  beqz      $v0, .L8013C4FC
/* D2BF4 8013C4F4 0220802D */   daddu    $s0, $s1, $zero
/* D2BF8 8013C4F8 0000802D */  daddu     $s0, $zero, $zero
.L8013C4FC:
/* D2BFC 8013C4FC 96620008 */  lhu       $v0, 0x8($s3)
/* D2C00 8013C500 00022040 */  sll       $a0, $v0, 1
/* D2C04 8013C504 00822021 */  addu      $a0, $a0, $v0
/* D2C08 8013C508 0C00AB39 */  jal       heap_malloc
/* D2C0C 8013C50C 00042080 */   sll      $a0, $a0, 2
/* D2C10 8013C510 0040F02D */  daddu     $fp, $v0, $zero
/* D2C14 8013C514 96670008 */  lhu       $a3, 0x8($s3)
/* D2C18 8013C518 03C0302D */  daddu     $a2, $fp, $zero
/* D2C1C 8013C51C 02270018 */  mult      $s1, $a3
/* D2C20 8013C520 3C150025 */  lui       $s5, %hi(D_24B7F0)
/* D2C24 8013C524 26B5B7F0 */  addiu     $s5, $s5, %lo(D_24B7F0)
/* D2C28 8013C528 00072840 */  sll       $a1, $a3, 1
/* D2C2C 8013C52C 00A72821 */  addu      $a1, $a1, $a3
/* D2C30 8013C530 00052880 */  sll       $a1, $a1, 2
/* D2C34 8013C534 00001812 */  mflo      $v1
/* D2C38 8013C538 00031040 */  sll       $v0, $v1, 1
/* D2C3C 8013C53C 00431021 */  addu      $v0, $v0, $v1
/* D2C40 8013C540 00021080 */  sll       $v0, $v0, 2
/* D2C44 8013C544 8E630000 */  lw        $v1, 0x0($s3)
/* D2C48 8013C548 00551021 */  addu      $v0, $v0, $s5
/* D2C4C 8013C54C 00622021 */  addu      $a0, $v1, $v0
/* D2C50 8013C550 0C00A5CF */  jal       dma_copy
/* D2C54 8013C554 00852821 */   addu     $a1, $a0, $a1
/* D2C58 8013C558 2A820002 */  slti      $v0, $s4, 0x2
/* D2C5C 8013C55C 14400017 */  bnez      $v0, .L8013C5BC
/* D2C60 8013C560 0000502D */   daddu    $t2, $zero, $zero
/* D2C64 8013C564 96620008 */  lhu       $v0, 0x8($s3)
/* D2C68 8013C568 00022040 */  sll       $a0, $v0, 1
/* D2C6C 8013C56C 00822021 */  addu      $a0, $a0, $v0
/* D2C70 8013C570 0C00AB39 */  jal       heap_malloc
/* D2C74 8013C574 00042080 */   sll      $a0, $a0, 2
/* D2C78 8013C578 96670008 */  lhu       $a3, 0x8($s3)
/* D2C7C 8013C57C 0040B82D */  daddu     $s7, $v0, $zero
/* D2C80 8013C580 02070018 */  mult      $s0, $a3
/* D2C84 8013C584 02E0302D */  daddu     $a2, $s7, $zero
/* D2C88 8013C588 00072840 */  sll       $a1, $a3, 1
/* D2C8C 8013C58C 00A72821 */  addu      $a1, $a1, $a3
/* D2C90 8013C590 00052880 */  sll       $a1, $a1, 2
/* D2C94 8013C594 00001812 */  mflo      $v1
/* D2C98 8013C598 00031040 */  sll       $v0, $v1, 1
/* D2C9C 8013C59C 00431021 */  addu      $v0, $v0, $v1
/* D2CA0 8013C5A0 00021080 */  sll       $v0, $v0, 2
/* D2CA4 8013C5A4 8E630000 */  lw        $v1, 0x0($s3)
/* D2CA8 8013C5A8 00551021 */  addu      $v0, $v0, $s5
/* D2CAC 8013C5AC 00622021 */  addu      $a0, $v1, $v0
/* D2CB0 8013C5B0 0C00A5CF */  jal       dma_copy
/* D2CB4 8013C5B4 00852821 */   addu     $a1, $a0, $a1
/* D2CB8 8013C5B8 0000502D */  daddu     $t2, $zero, $zero
.L8013C5BC:
/* D2CBC 8013C5BC 44960000 */  mtc1      $s6, $f0
/* D2CC0 8013C5C0 00000000 */  nop
/* D2CC4 8013C5C4 46800020 */  cvt.s.w   $f0, $f0
/* D2CC8 8013C5C8 44941000 */  mtc1      $s4, $f2
/* D2CCC 8013C5CC 00000000 */  nop
/* D2CD0 8013C5D0 468010A0 */  cvt.s.w   $f2, $f2
/* D2CD4 8013C5D4 96620008 */  lhu       $v0, 0x8($s3)
/* D2CD8 8013C5D8 104001EE */  beqz      $v0, .L8013CD94
/* D2CDC 8013C5DC 46020103 */   div.s    $f4, $f0, $f2
/* D2CE0 8013C5E0 3C098007 */  lui       $t1, %hi(gCurrentDisplayContextIndex)
/* D2CE4 8013C5E4 252941F4 */  addiu     $t1, $t1, %lo(gCurrentDisplayContextIndex)
/* D2CE8 8013C5E8 3C0B8015 */  lui       $t3, %hi(ImgFXCurrentTexturePtr)
/* D2CEC 8013C5EC 256BEE10 */  addiu     $t3, $t3, %lo(ImgFXCurrentTexturePtr)
/* D2CF0 8013C5F0 3C0C8000 */  lui       $t4, (0x80000000 >> 16)
/* D2CF4 8013C5F4 03C0302D */  daddu     $a2, $fp, $zero
/* D2CF8 8013C5F8 0140382D */  daddu     $a3, $t2, $zero
/* D2CFC 8013C5FC 02E0402D */  daddu     $t0, $s7, $zero
/* D2D00 8013C600 3C018015 */  lui       $at, %hi(D_801510E8)
/* D2D04 8013C604 D42610E8 */  ldc1      $f6, %lo(D_801510E8)($at)
/* D2D08 8013C608 3C0141E0 */  lui       $at, (0x41E00000 >> 16)
/* D2D0C 8013C60C 44814800 */  mtc1      $at, $f9
/* D2D10 8013C610 44804000 */  mtc1      $zero, $f8
.L8013C614:
/* D2D14 8013C614 92430001 */  lbu       $v1, 0x1($s2)
/* D2D18 8013C618 24020002 */  addiu     $v0, $zero, 0x2
/* D2D1C 8013C61C 14620256 */  bne       $v1, $v0, .L8013CF78
/* D2D20 8013C620 0282102A */   slt      $v0, $s4, $v0
/* D2D24 8013C624 14400108 */  bnez      $v0, .L8013CA48
/* D2D28 8013C628 00000000 */   nop
/* D2D2C 8013C62C 9662000E */  lhu       $v0, 0xE($s3)
/* D2D30 8013C630 30420001 */  andi      $v0, $v0, 0x1
/* D2D34 8013C634 10400039 */  beqz      $v0, .L8013C71C
/* D2D38 8013C638 00000000 */   nop
/* D2D3C 8013C63C 84C30000 */  lh        $v1, 0x0($a2)
/* D2D40 8013C640 85020000 */  lh        $v0, 0x0($t0)
/* D2D44 8013C644 8D240000 */  lw        $a0, 0x0($t1)
/* D2D48 8013C648 00431023 */  subu      $v0, $v0, $v1
/* D2D4C 8013C64C 44821000 */  mtc1      $v0, $f2
/* D2D50 8013C650 00000000 */  nop
/* D2D54 8013C654 468010A0 */  cvt.s.w   $f2, $f2
/* D2D58 8013C658 46041082 */  mul.s     $f2, $f2, $f4
/* D2D5C 8013C65C 00000000 */  nop
/* D2D60 8013C660 00042080 */  sll       $a0, $a0, 2
/* D2D64 8013C664 02442021 */  addu      $a0, $s2, $a0
/* D2D68 8013C668 44830000 */  mtc1      $v1, $f0
/* D2D6C 8013C66C 00000000 */  nop
/* D2D70 8013C670 46800020 */  cvt.s.w   $f0, $f0
/* D2D74 8013C674 8C820068 */  lw        $v0, 0x68($a0)
/* D2D78 8013C678 46020000 */  add.s     $f0, $f0, $f2
/* D2D7C 8013C67C 00E21021 */  addu      $v0, $a3, $v0
/* D2D80 8013C680 4600028D */  trunc.w.s $f10, $f0
/* D2D84 8013C684 44035000 */  mfc1      $v1, $f10
/* D2D88 8013C688 00000000 */  nop
/* D2D8C 8013C68C A4430000 */  sh        $v1, 0x0($v0)
/* D2D90 8013C690 84C30002 */  lh        $v1, 0x2($a2)
/* D2D94 8013C694 85020002 */  lh        $v0, 0x2($t0)
/* D2D98 8013C698 00431023 */  subu      $v0, $v0, $v1
/* D2D9C 8013C69C 44820000 */  mtc1      $v0, $f0
/* D2DA0 8013C6A0 00000000 */  nop
/* D2DA4 8013C6A4 46800020 */  cvt.s.w   $f0, $f0
/* D2DA8 8013C6A8 46040002 */  mul.s     $f0, $f0, $f4
/* D2DAC 8013C6AC 00000000 */  nop
/* D2DB0 8013C6B0 44831000 */  mtc1      $v1, $f2
/* D2DB4 8013C6B4 00000000 */  nop
/* D2DB8 8013C6B8 468010A0 */  cvt.s.w   $f2, $f2
/* D2DBC 8013C6BC 8C820068 */  lw        $v0, 0x68($a0)
/* D2DC0 8013C6C0 46001080 */  add.s     $f2, $f2, $f0
/* D2DC4 8013C6C4 00E21021 */  addu      $v0, $a3, $v0
/* D2DC8 8013C6C8 4600128D */  trunc.w.s $f10, $f2
/* D2DCC 8013C6CC 44035000 */  mfc1      $v1, $f10
/* D2DD0 8013C6D0 00000000 */  nop
/* D2DD4 8013C6D4 A4430002 */  sh        $v1, 0x2($v0)
/* D2DD8 8013C6D8 84C30004 */  lh        $v1, 0x4($a2)
/* D2DDC 8013C6DC 85020004 */  lh        $v0, 0x4($t0)
/* D2DE0 8013C6E0 00431023 */  subu      $v0, $v0, $v1
/* D2DE4 8013C6E4 44820000 */  mtc1      $v0, $f0
/* D2DE8 8013C6E8 00000000 */  nop
/* D2DEC 8013C6EC 46800020 */  cvt.s.w   $f0, $f0
/* D2DF0 8013C6F0 46040002 */  mul.s     $f0, $f0, $f4
/* D2DF4 8013C6F4 00000000 */  nop
/* D2DF8 8013C6F8 44831000 */  mtc1      $v1, $f2
/* D2DFC 8013C6FC 00000000 */  nop
/* D2E00 8013C700 468010A0 */  cvt.s.w   $f2, $f2
/* D2E04 8013C704 8C820068 */  lw        $v0, 0x68($a0)
/* D2E08 8013C708 46001080 */  add.s     $f2, $f2, $f0
/* D2E0C 8013C70C 4600128D */  trunc.w.s $f10, $f2
/* D2E10 8013C710 44035000 */  mfc1      $v1, $f10
/* D2E14 8013C714 0804F233 */  j         .L8013C8CC
/* D2E18 8013C718 00E21021 */   addu     $v0, $a3, $v0
.L8013C71C:
/* D2E1C 8013C71C 84C30000 */  lh        $v1, 0x0($a2)
/* D2E20 8013C720 85020000 */  lh        $v0, 0x0($t0)
/* D2E24 8013C724 00431023 */  subu      $v0, $v0, $v1
/* D2E28 8013C728 44821000 */  mtc1      $v0, $f2
/* D2E2C 8013C72C 00000000 */  nop
/* D2E30 8013C730 468010A0 */  cvt.s.w   $f2, $f2
/* D2E34 8013C734 46041082 */  mul.s     $f2, $f2, $f4
/* D2E38 8013C738 00000000 */  nop
/* D2E3C 8013C73C 44830000 */  mtc1      $v1, $f0
/* D2E40 8013C740 00000000 */  nop
/* D2E44 8013C744 46800020 */  cvt.s.w   $f0, $f0
/* D2E48 8013C748 46020000 */  add.s     $f0, $f0, $f2
/* D2E4C 8013C74C 4600028D */  trunc.w.s $f10, $f0
/* D2E50 8013C750 44025000 */  mfc1      $v0, $f10
/* D2E54 8013C754 00000000 */  nop
/* D2E58 8013C758 00021400 */  sll       $v0, $v0, 16
/* D2E5C 8013C75C 00021403 */  sra       $v0, $v0, 16
/* D2E60 8013C760 44821000 */  mtc1      $v0, $f2
/* D2E64 8013C764 00000000 */  nop
/* D2E68 8013C768 468010A1 */  cvt.d.w   $f2, $f2
/* D2E6C 8013C76C 46261082 */  mul.d     $f2, $f2, $f6
/* D2E70 8013C770 00000000 */  nop
/* D2E74 8013C774 8D650000 */  lw        $a1, 0x0($t3)
/* D2E78 8013C778 94A20008 */  lhu       $v0, 0x8($a1)
/* D2E7C 8013C77C 44820000 */  mtc1      $v0, $f0
/* D2E80 8013C780 00000000 */  nop
/* D2E84 8013C784 46800021 */  cvt.d.w   $f0, $f0
/* D2E88 8013C788 46201082 */  mul.d     $f2, $f2, $f0
/* D2E8C 8013C78C 00000000 */  nop
/* D2E90 8013C790 8D240000 */  lw        $a0, 0x0($t1)
/* D2E94 8013C794 00042080 */  sll       $a0, $a0, 2
/* D2E98 8013C798 02442021 */  addu      $a0, $s2, $a0
/* D2E9C 8013C79C 8C820068 */  lw        $v0, 0x68($a0)
/* D2EA0 8013C7A0 00E21021 */  addu      $v0, $a3, $v0
/* D2EA4 8013C7A4 4620128D */  trunc.w.d $f10, $f2
/* D2EA8 8013C7A8 44035000 */  mfc1      $v1, $f10
/* D2EAC 8013C7AC 00000000 */  nop
/* D2EB0 8013C7B0 A4430000 */  sh        $v1, 0x0($v0)
/* D2EB4 8013C7B4 84C30002 */  lh        $v1, 0x2($a2)
/* D2EB8 8013C7B8 85020002 */  lh        $v0, 0x2($t0)
/* D2EBC 8013C7BC 00431023 */  subu      $v0, $v0, $v1
/* D2EC0 8013C7C0 44821000 */  mtc1      $v0, $f2
/* D2EC4 8013C7C4 00000000 */  nop
/* D2EC8 8013C7C8 468010A0 */  cvt.s.w   $f2, $f2
/* D2ECC 8013C7CC 46041082 */  mul.s     $f2, $f2, $f4
/* D2ED0 8013C7D0 00000000 */  nop
/* D2ED4 8013C7D4 44830000 */  mtc1      $v1, $f0
/* D2ED8 8013C7D8 00000000 */  nop
/* D2EDC 8013C7DC 46800020 */  cvt.s.w   $f0, $f0
/* D2EE0 8013C7E0 46020000 */  add.s     $f0, $f0, $f2
/* D2EE4 8013C7E4 4600028D */  trunc.w.s $f10, $f0
/* D2EE8 8013C7E8 44025000 */  mfc1      $v0, $f10
/* D2EEC 8013C7EC 00000000 */  nop
/* D2EF0 8013C7F0 00021400 */  sll       $v0, $v0, 16
/* D2EF4 8013C7F4 00021403 */  sra       $v0, $v0, 16
/* D2EF8 8013C7F8 44821000 */  mtc1      $v0, $f2
/* D2EFC 8013C7FC 00000000 */  nop
/* D2F00 8013C800 468010A1 */  cvt.d.w   $f2, $f2
/* D2F04 8013C804 46261082 */  mul.d     $f2, $f2, $f6
/* D2F08 8013C808 00000000 */  nop
/* D2F0C 8013C80C 94A2000A */  lhu       $v0, 0xA($a1)
/* D2F10 8013C810 44820000 */  mtc1      $v0, $f0
/* D2F14 8013C814 00000000 */  nop
/* D2F18 8013C818 46800021 */  cvt.d.w   $f0, $f0
/* D2F1C 8013C81C 46201082 */  mul.d     $f2, $f2, $f0
/* D2F20 8013C820 00000000 */  nop
/* D2F24 8013C824 8C820068 */  lw        $v0, 0x68($a0)
/* D2F28 8013C828 00E21021 */  addu      $v0, $a3, $v0
/* D2F2C 8013C82C 4620128D */  trunc.w.d $f10, $f2
/* D2F30 8013C830 44035000 */  mfc1      $v1, $f10
/* D2F34 8013C834 00000000 */  nop
/* D2F38 8013C838 A4430002 */  sh        $v1, 0x2($v0)
/* D2F3C 8013C83C 84C30004 */  lh        $v1, 0x4($a2)
/* D2F40 8013C840 85020004 */  lh        $v0, 0x4($t0)
/* D2F44 8013C844 00431023 */  subu      $v0, $v0, $v1
/* D2F48 8013C848 44821000 */  mtc1      $v0, $f2
/* D2F4C 8013C84C 00000000 */  nop
/* D2F50 8013C850 468010A0 */  cvt.s.w   $f2, $f2
/* D2F54 8013C854 46041082 */  mul.s     $f2, $f2, $f4
/* D2F58 8013C858 00000000 */  nop
/* D2F5C 8013C85C 44830000 */  mtc1      $v1, $f0
/* D2F60 8013C860 00000000 */  nop
/* D2F64 8013C864 46800020 */  cvt.s.w   $f0, $f0
/* D2F68 8013C868 46020000 */  add.s     $f0, $f0, $f2
/* D2F6C 8013C86C 4600028D */  trunc.w.s $f10, $f0
/* D2F70 8013C870 44025000 */  mfc1      $v0, $f10
/* D2F74 8013C874 00000000 */  nop
/* D2F78 8013C878 00021400 */  sll       $v0, $v0, 16
/* D2F7C 8013C87C 00021403 */  sra       $v0, $v0, 16
/* D2F80 8013C880 44821000 */  mtc1      $v0, $f2
/* D2F84 8013C884 00000000 */  nop
/* D2F88 8013C888 468010A1 */  cvt.d.w   $f2, $f2
/* D2F8C 8013C88C 46261082 */  mul.d     $f2, $f2, $f6
/* D2F90 8013C890 00000000 */  nop
/* D2F94 8013C894 94A3000A */  lhu       $v1, 0xA($a1)
/* D2F98 8013C898 94A20008 */  lhu       $v0, 0x8($a1)
/* D2F9C 8013C89C 00431021 */  addu      $v0, $v0, $v1
/* D2FA0 8013C8A0 00021043 */  sra       $v0, $v0, 1
/* D2FA4 8013C8A4 44820000 */  mtc1      $v0, $f0
/* D2FA8 8013C8A8 00000000 */  nop
/* D2FAC 8013C8AC 46800021 */  cvt.d.w   $f0, $f0
/* D2FB0 8013C8B0 46201082 */  mul.d     $f2, $f2, $f0
/* D2FB4 8013C8B4 00000000 */  nop
/* D2FB8 8013C8B8 8C820068 */  lw        $v0, 0x68($a0)
/* D2FBC 8013C8BC 00E21021 */  addu      $v0, $a3, $v0
/* D2FC0 8013C8C0 4620128D */  trunc.w.d $f10, $f2
/* D2FC4 8013C8C4 44035000 */  mfc1      $v1, $f10
/* D2FC8 8013C8C8 00000000 */  nop
.L8013C8CC:
/* D2FCC 8013C8CC A4430004 */  sh        $v1, 0x4($v0)
/* D2FD0 8013C8D0 8E420014 */  lw        $v0, 0x14($s2)
/* D2FD4 8013C8D4 3042A000 */  andi      $v0, $v0, 0xA000
/* D2FD8 8013C8D8 10400040 */  beqz      $v0, .L8013C9DC
/* D2FDC 8013C8DC 00000000 */   nop
/* D2FE0 8013C8E0 80C30008 */  lb        $v1, 0x8($a2)
/* D2FE4 8013C8E4 81020008 */  lb        $v0, 0x8($t0)
/* D2FE8 8013C8E8 00431023 */  subu      $v0, $v0, $v1
/* D2FEC 8013C8EC 44821000 */  mtc1      $v0, $f2
/* D2FF0 8013C8F0 00000000 */  nop
/* D2FF4 8013C8F4 468010A0 */  cvt.s.w   $f2, $f2
/* D2FF8 8013C8F8 46041082 */  mul.s     $f2, $f2, $f4
/* D2FFC 8013C8FC 00000000 */  nop
/* D3000 8013C900 8D220000 */  lw        $v0, 0x0($t1)
/* D3004 8013C904 44830000 */  mtc1      $v1, $f0
/* D3008 8013C908 00000000 */  nop
/* D300C 8013C90C 46800020 */  cvt.s.w   $f0, $f0
/* D3010 8013C910 00021080 */  sll       $v0, $v0, 2
/* D3014 8013C914 02421021 */  addu      $v0, $s2, $v0
/* D3018 8013C918 8C420068 */  lw        $v0, 0x68($v0)
/* D301C 8013C91C 46020000 */  add.s     $f0, $f0, $f2
/* D3020 8013C920 00E21021 */  addu      $v0, $a3, $v0
/* D3024 8013C924 4600028D */  trunc.w.s $f10, $f0
/* D3028 8013C928 44035000 */  mfc1      $v1, $f10
/* D302C 8013C92C 00000000 */  nop
/* D3030 8013C930 A043000C */  sb        $v1, 0xC($v0)
/* D3034 8013C934 80C30009 */  lb        $v1, 0x9($a2)
/* D3038 8013C938 81020009 */  lb        $v0, 0x9($t0)
/* D303C 8013C93C 00431023 */  subu      $v0, $v0, $v1
/* D3040 8013C940 44821000 */  mtc1      $v0, $f2
/* D3044 8013C944 00000000 */  nop
/* D3048 8013C948 468010A0 */  cvt.s.w   $f2, $f2
/* D304C 8013C94C 46041082 */  mul.s     $f2, $f2, $f4
/* D3050 8013C950 00000000 */  nop
/* D3054 8013C954 8D220000 */  lw        $v0, 0x0($t1)
/* D3058 8013C958 44830000 */  mtc1      $v1, $f0
/* D305C 8013C95C 00000000 */  nop
/* D3060 8013C960 46800020 */  cvt.s.w   $f0, $f0
/* D3064 8013C964 00021080 */  sll       $v0, $v0, 2
/* D3068 8013C968 02421021 */  addu      $v0, $s2, $v0
/* D306C 8013C96C 8C420068 */  lw        $v0, 0x68($v0)
/* D3070 8013C970 46020000 */  add.s     $f0, $f0, $f2
/* D3074 8013C974 00E21021 */  addu      $v0, $a3, $v0
/* D3078 8013C978 4600028D */  trunc.w.s $f10, $f0
/* D307C 8013C97C 44035000 */  mfc1      $v1, $f10
/* D3080 8013C980 00000000 */  nop
/* D3084 8013C984 A043000D */  sb        $v1, 0xD($v0)
/* D3088 8013C988 80C3000A */  lb        $v1, 0xA($a2)
/* D308C 8013C98C 8102000A */  lb        $v0, 0xA($t0)
/* D3090 8013C990 00431023 */  subu      $v0, $v0, $v1
/* D3094 8013C994 44821000 */  mtc1      $v0, $f2
/* D3098 8013C998 00000000 */  nop
/* D309C 8013C99C 468010A0 */  cvt.s.w   $f2, $f2
/* D30A0 8013C9A0 46041082 */  mul.s     $f2, $f2, $f4
/* D30A4 8013C9A4 00000000 */  nop
/* D30A8 8013C9A8 8D220000 */  lw        $v0, 0x0($t1)
/* D30AC 8013C9AC 44830000 */  mtc1      $v1, $f0
/* D30B0 8013C9B0 00000000 */  nop
/* D30B4 8013C9B4 46800020 */  cvt.s.w   $f0, $f0
/* D30B8 8013C9B8 00021080 */  sll       $v0, $v0, 2
/* D30BC 8013C9BC 02421021 */  addu      $v0, $s2, $v0
/* D30C0 8013C9C0 8C420068 */  lw        $v0, 0x68($v0)
/* D30C4 8013C9C4 46020000 */  add.s     $f0, $f0, $f2
/* D30C8 8013C9C8 00E21021 */  addu      $v0, $a3, $v0
/* D30CC 8013C9CC 4600028D */  trunc.w.s $f10, $f0
/* D30D0 8013C9D0 44035000 */  mfc1      $v1, $f10
/* D30D4 8013C9D4 0804F321 */  j         .L8013CC84
/* D30D8 8013C9D8 A043000E */   sb       $v1, 0xE($v0)
.L8013C9DC:
/* D30DC 8013C9DC 90C30006 */  lbu       $v1, 0x6($a2)
/* D30E0 8013C9E0 90C20007 */  lbu       $v0, 0x7($a2)
/* D30E4 8013C9E4 3C018015 */  lui       $at, %hi(D_801510F0)
/* D30E8 8013C9E8 D42210F0 */  ldc1      $f2, %lo(D_801510F0)($at)
/* D30EC 8013C9EC 00621821 */  addu      $v1, $v1, $v0
/* D30F0 8013C9F0 44830000 */  mtc1      $v1, $f0
/* D30F4 8013C9F4 00000000 */  nop
/* D30F8 8013C9F8 46800021 */  cvt.d.w   $f0, $f0
/* D30FC 8013C9FC 46220002 */  mul.d     $f0, $f0, $f2
/* D3100 8013CA00 00000000 */  nop
/* D3104 8013CA04 8D220000 */  lw        $v0, 0x0($t1)
/* D3108 8013CA08 00021080 */  sll       $v0, $v0, 2
/* D310C 8013CA0C 02421021 */  addu      $v0, $s2, $v0
/* D3110 8013CA10 8C420068 */  lw        $v0, 0x68($v0)
/* D3114 8013CA14 3C01406E */  lui       $at, (0x406E0000 >> 16)
/* D3118 8013CA18 44811800 */  mtc1      $at, $f3
/* D311C 8013CA1C 44801000 */  mtc1      $zero, $f2
/* D3120 8013CA20 00E21021 */  addu      $v0, $a3, $v0
/* D3124 8013CA24 2445000C */  addiu     $a1, $v0, 0xC
/* D3128 8013CA28 46201001 */  sub.d     $f0, $f2, $f0
/* D312C 8013CA2C 2444000D */  addiu     $a0, $v0, 0xD
/* D3130 8013CA30 4620403E */  c.le.d    $f8, $f0
/* D3134 8013CA34 00000000 */  nop
/* D3138 8013CA38 45000086 */  bc1f      .L8013CC54
/* D313C 8013CA3C 2442000E */   addiu    $v0, $v0, 0xE
/* D3140 8013CA40 0804F31A */  j         .L8013CC68
/* D3144 8013CA44 46280001 */   sub.d    $f0, $f0, $f8
.L8013CA48:
/* D3148 8013CA48 9662000E */  lhu       $v0, 0xE($s3)
/* D314C 8013CA4C 30420001 */  andi      $v0, $v0, 0x1
/* D3150 8013CA50 10400010 */  beqz      $v0, .L8013CA94
/* D3154 8013CA54 00000000 */   nop
/* D3158 8013CA58 8D230000 */  lw        $v1, 0x0($t1)
/* D315C 8013CA5C 00031880 */  sll       $v1, $v1, 2
/* D3160 8013CA60 02431821 */  addu      $v1, $s2, $v1
/* D3164 8013CA64 8C620068 */  lw        $v0, 0x68($v1)
/* D3168 8013CA68 94C40000 */  lhu       $a0, 0x0($a2)
/* D316C 8013CA6C 00E21021 */  addu      $v0, $a3, $v0
/* D3170 8013CA70 A4440000 */  sh        $a0, 0x0($v0)
/* D3174 8013CA74 8C620068 */  lw        $v0, 0x68($v1)
/* D3178 8013CA78 94C40002 */  lhu       $a0, 0x2($a2)
/* D317C 8013CA7C 00E21021 */  addu      $v0, $a3, $v0
/* D3180 8013CA80 A4440002 */  sh        $a0, 0x2($v0)
/* D3184 8013CA84 8C620068 */  lw        $v0, 0x68($v1)
/* D3188 8013CA88 94C30004 */  lhu       $v1, 0x4($a2)
/* D318C 8013CA8C 0804F2E1 */  j         .L8013CB84
/* D3190 8013CA90 00E21021 */   addu     $v0, $a3, $v0
.L8013CA94:
/* D3194 8013CA94 84C20000 */  lh        $v0, 0x0($a2)
/* D3198 8013CA98 44821000 */  mtc1      $v0, $f2
/* D319C 8013CA9C 00000000 */  nop
/* D31A0 8013CAA0 468010A1 */  cvt.d.w   $f2, $f2
/* D31A4 8013CAA4 46261082 */  mul.d     $f2, $f2, $f6
/* D31A8 8013CAA8 00000000 */  nop
/* D31AC 8013CAAC 8D650000 */  lw        $a1, 0x0($t3)
/* D31B0 8013CAB0 94A20008 */  lhu       $v0, 0x8($a1)
/* D31B4 8013CAB4 44820000 */  mtc1      $v0, $f0
/* D31B8 8013CAB8 00000000 */  nop
/* D31BC 8013CABC 46800021 */  cvt.d.w   $f0, $f0
/* D31C0 8013CAC0 46201082 */  mul.d     $f2, $f2, $f0
/* D31C4 8013CAC4 00000000 */  nop
/* D31C8 8013CAC8 8D240000 */  lw        $a0, 0x0($t1)
/* D31CC 8013CACC 00042080 */  sll       $a0, $a0, 2
/* D31D0 8013CAD0 02442021 */  addu      $a0, $s2, $a0
/* D31D4 8013CAD4 8C820068 */  lw        $v0, 0x68($a0)
/* D31D8 8013CAD8 00E21021 */  addu      $v0, $a3, $v0
/* D31DC 8013CADC 4620128D */  trunc.w.d $f10, $f2
/* D31E0 8013CAE0 44035000 */  mfc1      $v1, $f10
/* D31E4 8013CAE4 00000000 */  nop
/* D31E8 8013CAE8 A4430000 */  sh        $v1, 0x0($v0)
/* D31EC 8013CAEC 84C20002 */  lh        $v0, 0x2($a2)
/* D31F0 8013CAF0 44821000 */  mtc1      $v0, $f2
/* D31F4 8013CAF4 00000000 */  nop
/* D31F8 8013CAF8 468010A1 */  cvt.d.w   $f2, $f2
/* D31FC 8013CAFC 46261082 */  mul.d     $f2, $f2, $f6
/* D3200 8013CB00 00000000 */  nop
/* D3204 8013CB04 94A2000A */  lhu       $v0, 0xA($a1)
/* D3208 8013CB08 44820000 */  mtc1      $v0, $f0
/* D320C 8013CB0C 00000000 */  nop
/* D3210 8013CB10 46800021 */  cvt.d.w   $f0, $f0
/* D3214 8013CB14 46201082 */  mul.d     $f2, $f2, $f0
/* D3218 8013CB18 00000000 */  nop
/* D321C 8013CB1C 8C820068 */  lw        $v0, 0x68($a0)
/* D3220 8013CB20 00E21021 */  addu      $v0, $a3, $v0
/* D3224 8013CB24 4620128D */  trunc.w.d $f10, $f2
/* D3228 8013CB28 44035000 */  mfc1      $v1, $f10
/* D322C 8013CB2C 00000000 */  nop
/* D3230 8013CB30 A4430002 */  sh        $v1, 0x2($v0)
/* D3234 8013CB34 84C20004 */  lh        $v0, 0x4($a2)
/* D3238 8013CB38 44821000 */  mtc1      $v0, $f2
/* D323C 8013CB3C 00000000 */  nop
/* D3240 8013CB40 468010A1 */  cvt.d.w   $f2, $f2
/* D3244 8013CB44 46261082 */  mul.d     $f2, $f2, $f6
/* D3248 8013CB48 00000000 */  nop
/* D324C 8013CB4C 94A3000A */  lhu       $v1, 0xA($a1)
/* D3250 8013CB50 94A20008 */  lhu       $v0, 0x8($a1)
/* D3254 8013CB54 00431021 */  addu      $v0, $v0, $v1
/* D3258 8013CB58 00021043 */  sra       $v0, $v0, 1
/* D325C 8013CB5C 44820000 */  mtc1      $v0, $f0
/* D3260 8013CB60 00000000 */  nop
/* D3264 8013CB64 46800021 */  cvt.d.w   $f0, $f0
/* D3268 8013CB68 46201082 */  mul.d     $f2, $f2, $f0
/* D326C 8013CB6C 00000000 */  nop
/* D3270 8013CB70 8C820068 */  lw        $v0, 0x68($a0)
/* D3274 8013CB74 00E21021 */  addu      $v0, $a3, $v0
/* D3278 8013CB78 4620128D */  trunc.w.d $f10, $f2
/* D327C 8013CB7C 44035000 */  mfc1      $v1, $f10
/* D3280 8013CB80 00000000 */  nop
.L8013CB84:
/* D3284 8013CB84 A4430004 */  sh        $v1, 0x4($v0)
/* D3288 8013CB88 8E420014 */  lw        $v0, 0x14($s2)
/* D328C 8013CB8C 3042A000 */  andi      $v0, $v0, 0xA000
/* D3290 8013CB90 10400017 */  beqz      $v0, .L8013CBF0
/* D3294 8013CB94 00000000 */   nop
/* D3298 8013CB98 8D220000 */  lw        $v0, 0x0($t1)
/* D329C 8013CB9C 00021080 */  sll       $v0, $v0, 2
/* D32A0 8013CBA0 02421021 */  addu      $v0, $s2, $v0
/* D32A4 8013CBA4 8C420068 */  lw        $v0, 0x68($v0)
/* D32A8 8013CBA8 90C30008 */  lbu       $v1, 0x8($a2)
/* D32AC 8013CBAC 00E21021 */  addu      $v0, $a3, $v0
/* D32B0 8013CBB0 A043000C */  sb        $v1, 0xC($v0)
/* D32B4 8013CBB4 8D220000 */  lw        $v0, 0x0($t1)
/* D32B8 8013CBB8 00021080 */  sll       $v0, $v0, 2
/* D32BC 8013CBBC 02421021 */  addu      $v0, $s2, $v0
/* D32C0 8013CBC0 8C420068 */  lw        $v0, 0x68($v0)
/* D32C4 8013CBC4 90C30009 */  lbu       $v1, 0x9($a2)
/* D32C8 8013CBC8 00E21021 */  addu      $v0, $a3, $v0
/* D32CC 8013CBCC A043000D */  sb        $v1, 0xD($v0)
/* D32D0 8013CBD0 8D220000 */  lw        $v0, 0x0($t1)
/* D32D4 8013CBD4 00021080 */  sll       $v0, $v0, 2
/* D32D8 8013CBD8 02421021 */  addu      $v0, $s2, $v0
/* D32DC 8013CBDC 8C420068 */  lw        $v0, 0x68($v0)
/* D32E0 8013CBE0 90C3000A */  lbu       $v1, 0xA($a2)
/* D32E4 8013CBE4 00E21021 */  addu      $v0, $a3, $v0
/* D32E8 8013CBE8 0804F321 */  j         .L8013CC84
/* D32EC 8013CBEC A043000E */   sb       $v1, 0xE($v0)
.L8013CBF0:
/* D32F0 8013CBF0 90C30006 */  lbu       $v1, 0x6($a2)
/* D32F4 8013CBF4 90C20007 */  lbu       $v0, 0x7($a2)
/* D32F8 8013CBF8 3C018015 */  lui       $at, %hi(D_801510F8)
/* D32FC 8013CBFC D42210F8 */  ldc1      $f2, %lo(D_801510F8)($at)
/* D3300 8013CC00 00621821 */  addu      $v1, $v1, $v0
/* D3304 8013CC04 44830000 */  mtc1      $v1, $f0
/* D3308 8013CC08 00000000 */  nop
/* D330C 8013CC0C 46800021 */  cvt.d.w   $f0, $f0
/* D3310 8013CC10 46220002 */  mul.d     $f0, $f0, $f2
/* D3314 8013CC14 00000000 */  nop
/* D3318 8013CC18 8D220000 */  lw        $v0, 0x0($t1)
/* D331C 8013CC1C 00021080 */  sll       $v0, $v0, 2
/* D3320 8013CC20 02421021 */  addu      $v0, $s2, $v0
/* D3324 8013CC24 8C420068 */  lw        $v0, 0x68($v0)
/* D3328 8013CC28 3C01406E */  lui       $at, (0x406E0000 >> 16)
/* D332C 8013CC2C 44811800 */  mtc1      $at, $f3
/* D3330 8013CC30 44801000 */  mtc1      $zero, $f2
/* D3334 8013CC34 00E21021 */  addu      $v0, $a3, $v0
/* D3338 8013CC38 2445000C */  addiu     $a1, $v0, 0xC
/* D333C 8013CC3C 46201001 */  sub.d     $f0, $f2, $f0
/* D3340 8013CC40 2444000D */  addiu     $a0, $v0, 0xD
/* D3344 8013CC44 4620403E */  c.le.d    $f8, $f0
/* D3348 8013CC48 00000000 */  nop
/* D334C 8013CC4C 45010005 */  bc1t      .L8013CC64
/* D3350 8013CC50 2442000E */   addiu    $v0, $v0, 0xE
.L8013CC54:
/* D3354 8013CC54 4620028D */  trunc.w.d $f10, $f0
/* D3358 8013CC58 44035000 */  mfc1      $v1, $f10
/* D335C 8013CC5C 0804F31F */  j         .L8013CC7C
/* D3360 8013CC60 A0430000 */   sb       $v1, 0x0($v0)
.L8013CC64:
/* D3364 8013CC64 46280001 */  sub.d     $f0, $f0, $f8
.L8013CC68:
/* D3368 8013CC68 4620028D */  trunc.w.d $f10, $f0
/* D336C 8013CC6C 44035000 */  mfc1      $v1, $f10
/* D3370 8013CC70 00000000 */  nop
/* D3374 8013CC74 006C1825 */  or        $v1, $v1, $t4
/* D3378 8013CC78 A0430000 */  sb        $v1, 0x0($v0)
.L8013CC7C:
/* D337C 8013CC7C A0830000 */  sb        $v1, 0x0($a0)
/* D3380 8013CC80 A0A30000 */  sb        $v1, 0x0($a1)
.L8013CC84:
/* D3384 8013CC84 9662000E */  lhu       $v0, 0xE($s3)
/* D3388 8013CC88 30420001 */  andi      $v0, $v0, 0x1
/* D338C 8013CC8C 1040000E */  beqz      $v0, .L8013CCC8
/* D3390 8013CC90 00000000 */   nop
/* D3394 8013CC94 8D240000 */  lw        $a0, 0x0($t1)
/* D3398 8013CC98 90C20006 */  lbu       $v0, 0x6($a2)
/* D339C 8013CC9C 00042080 */  sll       $a0, $a0, 2
/* D33A0 8013CCA0 02442021 */  addu      $a0, $s2, $a0
/* D33A4 8013CCA4 24420100 */  addiu     $v0, $v0, 0x100
/* D33A8 8013CCA8 8C830068 */  lw        $v1, 0x68($a0)
/* D33AC 8013CCAC 00021140 */  sll       $v0, $v0, 5
/* D33B0 8013CCB0 00E31821 */  addu      $v1, $a3, $v1
/* D33B4 8013CCB4 A4620008 */  sh        $v0, 0x8($v1)
/* D33B8 8013CCB8 8C830068 */  lw        $v1, 0x68($a0)
/* D33BC 8013CCBC 90C20007 */  lbu       $v0, 0x7($a2)
/* D33C0 8013CCC0 0804F35B */  j         .L8013CD6C
/* D33C4 8013CCC4 00E31821 */   addu     $v1, $a3, $v1
.L8013CCC8:
/* D33C8 8013CCC8 90C20006 */  lbu       $v0, 0x6($a2)
/* D33CC 8013CCCC 44821000 */  mtc1      $v0, $f2
/* D33D0 8013CCD0 00000000 */  nop
/* D33D4 8013CCD4 468010A1 */  cvt.d.w   $f2, $f2
/* D33D8 8013CCD8 46261082 */  mul.d     $f2, $f2, $f6
/* D33DC 8013CCDC 00000000 */  nop
/* D33E0 8013CCE0 8D650000 */  lw        $a1, 0x0($t3)
/* D33E4 8013CCE4 94A20008 */  lhu       $v0, 0x8($a1)
/* D33E8 8013CCE8 44820000 */  mtc1      $v0, $f0
/* D33EC 8013CCEC 00000000 */  nop
/* D33F0 8013CCF0 46800021 */  cvt.d.w   $f0, $f0
/* D33F4 8013CCF4 46201082 */  mul.d     $f2, $f2, $f0
/* D33F8 8013CCF8 00000000 */  nop
/* D33FC 8013CCFC 8D240000 */  lw        $a0, 0x0($t1)
/* D3400 8013CD00 00042080 */  sll       $a0, $a0, 2
/* D3404 8013CD04 02442021 */  addu      $a0, $s2, $a0
/* D3408 8013CD08 8C830068 */  lw        $v1, 0x68($a0)
/* D340C 8013CD0C 00E31821 */  addu      $v1, $a3, $v1
/* D3410 8013CD10 4620128D */  trunc.w.d $f10, $f2
/* D3414 8013CD14 44025000 */  mfc1      $v0, $f10
/* D3418 8013CD18 00000000 */  nop
/* D341C 8013CD1C 24420100 */  addiu     $v0, $v0, 0x100
/* D3420 8013CD20 00021140 */  sll       $v0, $v0, 5
/* D3424 8013CD24 A4620008 */  sh        $v0, 0x8($v1)
/* D3428 8013CD28 90C20007 */  lbu       $v0, 0x7($a2)
/* D342C 8013CD2C 44821000 */  mtc1      $v0, $f2
/* D3430 8013CD30 00000000 */  nop
/* D3434 8013CD34 468010A1 */  cvt.d.w   $f2, $f2
/* D3438 8013CD38 46261082 */  mul.d     $f2, $f2, $f6
/* D343C 8013CD3C 00000000 */  nop
/* D3440 8013CD40 94A2000A */  lhu       $v0, 0xA($a1)
/* D3444 8013CD44 44820000 */  mtc1      $v0, $f0
/* D3448 8013CD48 00000000 */  nop
/* D344C 8013CD4C 46800021 */  cvt.d.w   $f0, $f0
/* D3450 8013CD50 46201082 */  mul.d     $f2, $f2, $f0
/* D3454 8013CD54 00000000 */  nop
/* D3458 8013CD58 8C830068 */  lw        $v1, 0x68($a0)
/* D345C 8013CD5C 00E31821 */  addu      $v1, $a3, $v1
/* D3460 8013CD60 4620128D */  trunc.w.d $f10, $f2
/* D3464 8013CD64 44025000 */  mfc1      $v0, $f10
/* D3468 8013CD68 00000000 */  nop
.L8013CD6C:
/* D346C 8013CD6C 24420100 */  addiu     $v0, $v0, 0x100
/* D3470 8013CD70 00021140 */  sll       $v0, $v0, 5
/* D3474 8013CD74 A462000A */  sh        $v0, 0xA($v1)
/* D3478 8013CD78 24C6000C */  addiu     $a2, $a2, 0xC
/* D347C 8013CD7C 24E70010 */  addiu     $a3, $a3, 0x10
/* D3480 8013CD80 96620008 */  lhu       $v0, 0x8($s3)
/* D3484 8013CD84 254A0001 */  addiu     $t2, $t2, 0x1
/* D3488 8013CD88 0142102A */  slt       $v0, $t2, $v0
/* D348C 8013CD8C 1440FE21 */  bnez      $v0, .L8013C614
/* D3490 8013CD90 2508000C */   addiu    $t0, $t0, 0xC
.L8013CD94:
/* D3494 8013CD94 A6400008 */  sh        $zero, 0x8($s2)
/* D3498 8013CD98 96620008 */  lhu       $v0, 0x8($s3)
/* D349C 8013CD9C 03C0202D */  daddu     $a0, $fp, $zero
/* D34A0 8013CDA0 2442FFFF */  addiu     $v0, $v0, -0x1
/* D34A4 8013CDA4 0C00AB4B */  jal       heap_free
/* D34A8 8013CDA8 A642000A */   sh       $v0, 0xA($s2)
/* D34AC 8013CDAC 12E00003 */  beqz      $s7, .L8013CDBC
/* D34B0 8013CDB0 00000000 */   nop
/* D34B4 8013CDB4 0C00AB4B */  jal       heap_free
/* D34B8 8013CDB8 02E0202D */   daddu    $a0, $s7, $zero
.L8013CDBC:
/* D34BC 8013CDBC 8FAD0014 */  lw        $t5, 0x14($sp)
/* D34C0 8013CDC0 11A0006D */  beqz      $t5, .L8013CF78
/* D34C4 8013CDC4 00000000 */   nop
/* D34C8 8013CDC8 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* D34CC 8013CDCC 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* D34D0 8013CDD0 94420134 */  lhu       $v0, 0x134($v0)
/* D34D4 8013CDD4 15A00002 */  bnez      $t5, .L8013CDE0
/* D34D8 8013CDD8 004D001A */   div      $zero, $v0, $t5
/* D34DC 8013CDDC 0007000D */  break     7
.L8013CDE0:
/* D34E0 8013CDE0 2401FFFF */  addiu     $at, $zero, -0x1
/* D34E4 8013CDE4 15A10004 */  bne       $t5, $at, .L8013CDF8
/* D34E8 8013CDE8 3C018000 */   lui      $at, (0x80000000 >> 16)
/* D34EC 8013CDEC 14410002 */  bne       $v0, $at, .L8013CDF8
/* D34F0 8013CDF0 00000000 */   nop
/* D34F4 8013CDF4 0006000D */  break     6
.L8013CDF8:
/* D34F8 8013CDF8 00001810 */  mfhi      $v1
/* D34FC 8013CDFC 1460005E */  bnez      $v1, .L8013CF78
/* D3500 8013CE00 00000000 */   nop
/* D3504 8013CE04 1A800027 */  blez      $s4, .L8013CEA4
/* D3508 8013CE08 00000000 */   nop
/* D350C 8013CE0C 26D60001 */  addiu     $s6, $s6, 0x1
/* D3510 8013CE10 02D4102A */  slt       $v0, $s6, $s4
/* D3514 8013CE14 14400050 */  bnez      $v0, .L8013CF58
/* D3518 8013CE18 00000000 */   nop
/* D351C 8013CE1C 8E430014 */  lw        $v1, 0x14($s2)
/* D3520 8013CE20 30620100 */  andi      $v0, $v1, 0x100
/* D3524 8013CE24 5040000E */  beql      $v0, $zero, .L8013CE60
/* D3528 8013CE28 26310001 */   addiu    $s1, $s1, 0x1
/* D352C 8013CE2C 2631FFFF */  addiu     $s1, $s1, -0x1
/* D3530 8013CE30 06230049 */  bgezl     $s1, .L8013CF58
/* D3534 8013CE34 0000B02D */   daddu    $s6, $zero, $zero
/* D3538 8013CE38 30620080 */  andi      $v0, $v1, 0x80
/* D353C 8013CE3C 10400004 */  beqz      $v0, .L8013CE50
/* D3540 8013CE40 30620800 */   andi     $v0, $v1, 0x800
/* D3544 8013CE44 9662000C */  lhu       $v0, 0xC($s3)
/* D3548 8013CE48 0804F3A7 */  j         .L8013CE9C
/* D354C 8013CE4C 2451FFFF */   addiu    $s1, $v0, -0x1
.L8013CE50:
/* D3550 8013CE50 10400010 */  beqz      $v0, .L8013CE94
/* D3554 8013CE54 34624000 */   ori      $v0, $v1, 0x4000
/* D3558 8013CE58 0804F3A6 */  j         .L8013CE98
/* D355C 8013CE5C 0000882D */   daddu    $s1, $zero, $zero
.L8013CE60:
/* D3560 8013CE60 9662000C */  lhu       $v0, 0xC($s3)
/* D3564 8013CE64 0222102A */  slt       $v0, $s1, $v0
/* D3568 8013CE68 1440003B */  bnez      $v0, .L8013CF58
/* D356C 8013CE6C 0000B02D */   daddu    $s6, $zero, $zero
/* D3570 8013CE70 30620080 */  andi      $v0, $v1, 0x80
/* D3574 8013CE74 10400003 */  beqz      $v0, .L8013CE84
/* D3578 8013CE78 30620800 */   andi     $v0, $v1, 0x800
/* D357C 8013CE7C 0804F3D6 */  j         .L8013CF58
/* D3580 8013CE80 0000882D */   daddu    $s1, $zero, $zero
.L8013CE84:
/* D3584 8013CE84 10400003 */  beqz      $v0, .L8013CE94
/* D3588 8013CE88 34624000 */   ori      $v0, $v1, 0x4000
/* D358C 8013CE8C 0804F3A6 */  j         .L8013CE98
/* D3590 8013CE90 2631FFFF */   addiu    $s1, $s1, -0x1
.L8013CE94:
/* D3594 8013CE94 34621000 */  ori       $v0, $v1, 0x1000
.L8013CE98:
/* D3598 8013CE98 AE420014 */  sw        $v0, 0x14($s2)
.L8013CE9C:
/* D359C 8013CE9C 0804F3D6 */  j         .L8013CF58
/* D35A0 8013CEA0 0000B02D */   daddu    $s6, $zero, $zero
.L8013CEA4:
/* D35A4 8013CEA4 0681002C */  bgez      $s4, .L8013CF58
/* D35A8 8013CEA8 00000000 */   nop
/* D35AC 8013CEAC 8E440014 */  lw        $a0, 0x14($s2)
/* D35B0 8013CEB0 30820100 */  andi      $v0, $a0, 0x100
/* D35B4 8013CEB4 1040000E */  beqz      $v0, .L8013CEF0
/* D35B8 8013CEB8 00000000 */   nop
/* D35BC 8013CEBC 8FAD0010 */  lw        $t5, 0x10($sp)
/* D35C0 8013CEC0 022D8823 */  subu      $s1, $s1, $t5
/* D35C4 8013CEC4 06210024 */  bgez      $s1, .L8013CF58
/* D35C8 8013CEC8 30820080 */   andi     $v0, $a0, 0x80
/* D35CC 8013CECC 10400004 */  beqz      $v0, .L8013CEE0
/* D35D0 8013CED0 30820800 */   andi     $v0, $a0, 0x800
/* D35D4 8013CED4 9662000C */  lhu       $v0, 0xC($s3)
/* D35D8 8013CED8 0804F3D6 */  j         .L8013CF58
/* D35DC 8013CEDC 02228821 */   addu     $s1, $s1, $v0
.L8013CEE0:
/* D35E0 8013CEE0 1040001B */  beqz      $v0, .L8013CF50
/* D35E4 8013CEE4 34824000 */   ori      $v0, $a0, 0x4000
/* D35E8 8013CEE8 0804F3D5 */  j         .L8013CF54
/* D35EC 8013CEEC 0000882D */   daddu    $s1, $zero, $zero
.L8013CEF0:
/* D35F0 8013CEF0 8FAD0010 */  lw        $t5, 0x10($sp)
/* D35F4 8013CEF4 9663000C */  lhu       $v1, 0xC($s3)
/* D35F8 8013CEF8 022D8821 */  addu      $s1, $s1, $t5
/* D35FC 8013CEFC 0223102A */  slt       $v0, $s1, $v1
/* D3600 8013CF00 14400015 */  bnez      $v0, .L8013CF58
/* D3604 8013CF04 30820080 */   andi     $v0, $a0, 0x80
/* D3608 8013CF08 1040000D */  beqz      $v0, .L8013CF40
/* D360C 8013CF0C 30820800 */   andi     $v0, $a0, 0x800
/* D3610 8013CF10 14600002 */  bnez      $v1, .L8013CF1C
/* D3614 8013CF14 0223001A */   div      $zero, $s1, $v1
/* D3618 8013CF18 0007000D */  break     7
.L8013CF1C:
/* D361C 8013CF1C 2401FFFF */  addiu     $at, $zero, -0x1
/* D3620 8013CF20 14610004 */  bne       $v1, $at, .L8013CF34
/* D3624 8013CF24 3C018000 */   lui      $at, (0x80000000 >> 16)
/* D3628 8013CF28 16210002 */  bne       $s1, $at, .L8013CF34
/* D362C 8013CF2C 00000000 */   nop
/* D3630 8013CF30 0006000D */  break     6
.L8013CF34:
/* D3634 8013CF34 00008810 */  mfhi      $s1
/* D3638 8013CF38 0804F3D6 */  j         .L8013CF58
/* D363C 8013CF3C 00000000 */   nop
.L8013CF40:
/* D3640 8013CF40 10400003 */  beqz      $v0, .L8013CF50
/* D3644 8013CF44 34824000 */   ori      $v0, $a0, 0x4000
/* D3648 8013CF48 0804F3D5 */  j         .L8013CF54
/* D364C 8013CF4C 2471FFFF */   addiu    $s1, $v1, -0x1
.L8013CF50:
/* D3650 8013CF50 34821000 */  ori       $v0, $a0, 0x1000
.L8013CF54:
/* D3654 8013CF54 AE420014 */  sw        $v0, 0x14($s2)
.L8013CF58:
/* D3658 8013CF58 44960000 */  mtc1      $s6, $f0
/* D365C 8013CF5C 00000000 */  nop
/* D3660 8013CF60 46800020 */  cvt.s.w   $f0, $f0
/* D3664 8013CF64 E640003C */  swc1      $f0, 0x3C($s2)
/* D3668 8013CF68 44910000 */  mtc1      $s1, $f0
/* D366C 8013CF6C 00000000 */  nop
/* D3670 8013CF70 46800020 */  cvt.s.w   $f0, $f0
/* D3674 8013CF74 E6400040 */  swc1      $f0, 0x40($s2)
.L8013CF78:
/* D3678 8013CF78 8FBF003C */  lw        $ra, 0x3C($sp)
/* D367C 8013CF7C 8FBE0038 */  lw        $fp, 0x38($sp)
/* D3680 8013CF80 8FB70034 */  lw        $s7, 0x34($sp)
/* D3684 8013CF84 8FB60030 */  lw        $s6, 0x30($sp)
/* D3688 8013CF88 8FB5002C */  lw        $s5, 0x2C($sp)
/* D368C 8013CF8C 8FB40028 */  lw        $s4, 0x28($sp)
/* D3690 8013CF90 8FB30024 */  lw        $s3, 0x24($sp)
/* D3694 8013CF94 8FB20020 */  lw        $s2, 0x20($sp)
glabel func_8013CF98
/* D3698 8013CF98 8FB1001C */  lw        $s1, 0x1C($sp)
/* D369C 8013CF9C 8FB00018 */  lw        $s0, 0x18($sp)
/* D36A0 8013CFA0 03E00008 */  jr        $ra
/* D36A4 8013CFA4 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void imgfx_mesh_anim_update(ImgFXState* state) {
    s32 absKeyframeInterval;
    s32 nextKeyIdx;
    s32 curKeyIdx;
    ImgFXVtx* curKeyframe = NULL;
    ImgFXVtx* nextKeyframe = NULL;
    s32 keyframeInterval = state->ints.anim.interval;
    s32 animStep = state->ints.anim.step;
    s32 curSubframe = state->floats.anim.curFrame;
    ImgFXAnimHeader* header = imgfx_load_anim(state);
    u8* romStart;
    f32 lerpAlpha;
    s32 i;

    if (header == NULL) {
        return;
    }

    if (state->flags & IMGFX_FLAG_200) {
        state->flags &= ~IMGFX_FLAG_200;
        if (state->flags & IMGFX_FLAG_REVERSE_ANIM) {
            state->floats.anim.curIdx = header->keyframesCount - 1;
        }
    }
    curKeyIdx = state->floats.anim.curIdx;
    absKeyframeInterval = abs(keyframeInterval);
    if (state->flags & IMGFX_FLAG_4000) {
        nextKeyIdx = curKeyIdx;
    } else {
        if (state->flags & IMGFX_FLAG_REVERSE_ANIM) {
            nextKeyIdx = curKeyIdx - 1;
            if (nextKeyIdx < 0) {
                nextKeyIdx = curKeyIdx;
                if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                    nextKeyIdx = header->keyframesCount - 1;
                }
            }
        } else {
            nextKeyIdx = curKeyIdx + 1;
            if (nextKeyIdx == header->keyframesCount) {
                nextKeyIdx = curKeyIdx;
                if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                    nextKeyIdx = 0;
                }
            }
        }
    }

    // find the current + next keyframe vertex data
    curKeyframe = heap_malloc(header->vtxCount * sizeof(ImgFXVtx));
    romStart = (u8*)((s32)imgfx_data_ROM_START + (s32) header->keyframesOffset + curKeyIdx * header->vtxCount * sizeof(ImgFXVtx));
    dma_copy(romStart, romStart + header->vtxCount * sizeof(ImgFXVtx), curKeyframe);
    if (keyframeInterval > 1) {
        nextKeyframe = heap_malloc(header->vtxCount * sizeof(*nextKeyframe));
        romStart = (u8*)((s32)imgfx_data_ROM_START + (s32) header->keyframesOffset + nextKeyIdx * header->vtxCount * sizeof(ImgFXVtx));
        dma_copy(romStart, romStart + header->vtxCount * sizeof(ImgFXVtx), nextKeyframe);
    }

    lerpAlpha = (f32) curSubframe / (f32) keyframeInterval;
    for (i = 0; i < header->vtxCount; i++) {
        if (state->meshType != IMGFX_MESH_ANIMATED) {
            return;
        }

        if (keyframeInterval > 1) {
            // get vertex position, interpolated between keyframes
            if (header->flags & IMGFX_ANIM_FLAG_ABSOLUTE_COORDS) {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = (s16)(curKeyframe[i].ob[0] + (nextKeyframe[i].ob[0] - curKeyframe[i].ob[0]) * lerpAlpha);
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = (s16)(curKeyframe[i].ob[1] + (nextKeyframe[i].ob[1] - curKeyframe[i].ob[1]) * lerpAlpha);
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = (s16)(curKeyframe[i].ob[2] + (nextKeyframe[i].ob[2] - curKeyframe[i].ob[2]) * lerpAlpha);
            } else {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = (s16)(curKeyframe[i].ob[0] + (nextKeyframe[i].ob[0] - curKeyframe[i].ob[0]) * lerpAlpha) * 0.01 * ImgFXCurrentTexturePtr->tex.width;
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = (s16)(curKeyframe[i].ob[1] + (nextKeyframe[i].ob[1] - curKeyframe[i].ob[1]) * lerpAlpha) * 0.01 * ImgFXCurrentTexturePtr->tex.height;
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = (s16)(curKeyframe[i].ob[2] + (nextKeyframe[i].ob[2] - curKeyframe[i].ob[2]) * lerpAlpha) * 0.01 * ((ImgFXCurrentTexturePtr->tex.width + ImgFXCurrentTexturePtr->tex.height) / 2);
            }
            // get vertex color
            if (state->flags & (IMGFX_FLAG_2000 | IMGFX_FLAG_8000)) {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = (s16)(curKeyframe[i].cn[0] + (nextKeyframe[i].cn[0] - curKeyframe[i].cn[0]) * lerpAlpha);
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = (s16)(curKeyframe[i].cn[1] + (nextKeyframe[i].cn[1] - curKeyframe[i].cn[1]) * lerpAlpha);
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = (s16)(curKeyframe[i].cn[2] + (nextKeyframe[i].cn[2] - curKeyframe[i].cn[2]) * lerpAlpha);
            } else {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] =
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] =
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (curKeyframe[i].tc[0] + curKeyframe[i].tc[1]) * 1.2;
            }
        } else {
            // get vertex position
            if (header->flags & IMGFX_ANIM_FLAG_ABSOLUTE_COORDS) {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = curKeyframe[i].ob[0];
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = curKeyframe[i].ob[1];
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = curKeyframe[i].ob[2];
            } else {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[0] = curKeyframe[i].ob[0] * 0.01 * ImgFXCurrentTexturePtr->tex.width;
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[1] = curKeyframe[i].ob[1] * 0.01 * ImgFXCurrentTexturePtr->tex.height;
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.ob[2] = curKeyframe[i].ob[2] * 0.01 * ((ImgFXCurrentTexturePtr->tex.width + ImgFXCurrentTexturePtr->tex.height) / 2);
            }
            // get vertex color
            if (state->flags & (IMGFX_FLAG_2000 | IMGFX_FLAG_8000)) {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] = curKeyframe[i].cn[0];
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] = curKeyframe[i].cn[1];
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = curKeyframe[i].cn[2];
            } else {
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[0] =
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[1] =
                state->vtxBufs[gCurrentDisplayContextIndex][i].v.cn[2] = 240.0 - (curKeyframe[i].tc[0] + curKeyframe[i].tc[1]) * 1.2;
            }
        }
        // get vertex tex coords
        if (header->flags & IMGFX_ANIM_FLAG_ABSOLUTE_COORDS) {
            state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = (curKeyframe[i].tc[0] + 256) * 32;
            state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = (curKeyframe[i].tc[1] + 256) * 32;
        } else {
            state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[0] = ((s32)(curKeyframe[i].tc[0] * 0.01 * ImgFXCurrentTexturePtr->tex.width) + 256) * 32;
            state->vtxBufs[gCurrentDisplayContextIndex][i].v.tc[1] = ((s32)(curKeyframe[i].tc[1] * 0.01 * ImgFXCurrentTexturePtr->tex.height) + 256) * 32;
        }
    }

    state->firstVtxIdx = 0;
    state->lastVtxIdx = header->vtxCount - 1;

    heap_free(curKeyframe);
    if (nextKeyframe != NULL) {
        heap_free(nextKeyframe);
    }

    if (animStep == 0 || gGameStatusPtr->frameCounter % animStep != 0) {
        return;
    }

    if (keyframeInterval > 0) {
        curSubframe++;
        if (curSubframe >= keyframeInterval) {
            if (state->flags & IMGFX_FLAG_REVERSE_ANIM) {
                curKeyIdx--;
                if (curKeyIdx < 0) {
                    if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                        curKeyIdx = header->keyframesCount - 1;
                    } else {
                        if (state->flags & IMGFX_FLAG_800) {
                            curKeyIdx = 0;
                            state->flags |= IMGFX_FLAG_4000;
                        } else {
                            state->flags |= IMGFX_FLAG_ANIM_DONE;
                        }
                    }
                }
            } else {
                curKeyIdx++;
                if (curKeyIdx >= header->keyframesCount) {
                    if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                        curKeyIdx = 0;
                    } else {
                        if (state->flags & IMGFX_FLAG_800) {
                            curKeyIdx--;
                            state->flags |= IMGFX_FLAG_4000;
                        } else {
                            state->flags |= IMGFX_FLAG_ANIM_DONE;
                        }
                    }
                }
            }
            curSubframe = 0;
        }
    } else if (keyframeInterval < 0) {
        if (state->flags & IMGFX_FLAG_REVERSE_ANIM) {
            curKeyIdx -= absKeyframeInterval;
            if (curKeyIdx < 0) {
                if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                    curKeyIdx += header->keyframesCount;
                } else {
                    if (state->flags & IMGFX_FLAG_800) {
                        curKeyIdx = 0;
                        state->flags |= IMGFX_FLAG_4000;
                    } else {
                        state->flags |= IMGFX_FLAG_ANIM_DONE;
                    }
                }
            }
        } else {
            curKeyIdx += absKeyframeInterval;
            if (curKeyIdx >= header->keyframesCount) {
                if (state->flags & IMGFX_FLAG_LOOP_ANIM) {
                    curKeyIdx %= header->keyframesCount;
                } else {
                    if (state->flags & IMGFX_FLAG_800) {
                        curKeyIdx = header->keyframesCount - 1;
                        state->flags |= IMGFX_FLAG_4000;
                    } else {
                        state->flags |= IMGFX_FLAG_ANIM_DONE;
                    }
                }
            }
        }
    }

    state->floats.anim.curFrame = curSubframe;
    state->floats.anim.curIdx = curKeyIdx;
}