### RAW ASSEMBLY INSTRUCTIONS:

glabel ice_shard_appendGfx
/* 3F87DC E01103EC 27BDFF38 */  addiu     $sp, $sp, -0xC8
/* 3F87E0 E01103F0 0080402D */  daddu     $t0, $a0, $zero
/* 3F87E4 E01103F4 3C09DB06 */  lui       $t1, (0xDB060024 >> 16)
/* 3F87E8 E01103F8 35290024 */  ori       $t1, $t1, (0xDB060024 & 0xFFFF)
/* 3F87EC E01103FC AFB500B4 */  sw        $s5, 0xB4($sp)
/* 3F87F0 E0110400 3C15800A */  lui       $s5, %hi(gMainGfxPos)
/* 3F87F4 E0110404 26B5A66C */  addiu     $s5, $s5, %lo(gMainGfxPos)
/* 3F87F8 E0110408 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3F87FC E011040C AFBF00BC */  sw        $ra, 0xBC($sp)
/* 3F8800 E0110410 AFB600B8 */  sw        $s6, 0xB8($sp)
/* 3F8804 E0110414 AFB400B0 */  sw        $s4, 0xB0($sp)
/* 3F8808 E0110418 AFB300AC */  sw        $s3, 0xAC($sp)
/* 3F880C E011041C AFB200A8 */  sw        $s2, 0xA8($sp)
/* 3F8810 E0110420 AFB100A4 */  sw        $s1, 0xA4($sp)
/* 3F8814 E0110424 AFB000A0 */  sw        $s0, 0xA0($sp)
/* 3F8818 E0110428 F7B400C0 */  sdc1      $f20, 0xC0($sp)
/* 3F881C E011042C 8EA60000 */  lw        $a2, 0x0($s5)
/* 3F8820 E0110430 4480A000 */  mtc1      $zero, $f20
/* 3F8824 E0110434 8D14000C */  lw        $s4, 0xC($t0)
/* 3F8828 E0110438 00C0182D */  daddu     $v1, $a2, $zero
/* 3F882C E011043C 8E960024 */  lw        $s6, 0x24($s4)
/* 3F8830 E0110440 8E930000 */  lw        $s3, 0x0($s4)
/* 3F8834 E0110444 24C60008 */  addiu     $a2, $a2, 0x8
/* 3F8838 E0110448 AC620000 */  sw        $v0, 0x0($v1)
/* 3F883C E011044C AC600004 */  sw        $zero, 0x4($v1)
/* 3F8840 E0110450 ACC90000 */  sw        $t1, 0x0($a2)
/* 3F8844 E0110454 8D020010 */  lw        $v0, 0x10($t0)
/* 3F8848 E0110458 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 3F884C E011045C 4405A000 */  mfc1      $a1, $f20
/* 3F8850 E0110460 4407A000 */  mfc1      $a3, $f20
/* 3F8854 E0110464 8C42001C */  lw        $v0, 0x1C($v0)
/* 3F8858 E0110468 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3F885C E011046C 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3F8860 E0110470 00481021 */  addu      $v0, $v0, $t0
/* 3F8864 E0110474 ACC20004 */  sw        $v0, 0x4($a2)
/* 3F8868 E0110478 00031080 */  sll       $v0, $v1, 2
/* 3F886C E011047C 00431021 */  addu      $v0, $v0, $v1
/* 3F8870 E0110480 00021080 */  sll       $v0, $v0, 2
/* 3F8874 E0110484 00431023 */  subu      $v0, $v0, $v1
/* 3F8878 E0110488 000218C0 */  sll       $v1, $v0, 3
/* 3F887C E011048C 00431021 */  addu      $v0, $v0, $v1
/* 3F8880 E0110490 000210C0 */  sll       $v0, $v0, 3
/* 3F8884 E0110494 C6800038 */  lwc1      $f0, 0x38($s4)
/* 3F8888 E0110498 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3F888C E011049C 00220821 */  addu      $at, $at, $v0
/* 3F8890 E01104A0 C4221DEC */  lwc1      $f2, %lo(gCameras + 0x6C)($at)
/* 3F8894 E01104A4 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3F8898 E01104A8 C6800004 */  lwc1      $f0, 0x4($s4)
/* 3F889C E01104AC 27A40020 */  addiu     $a0, $sp, 0x20
/* 3F88A0 E01104B0 AEA60000 */  sw        $a2, 0x0($s5)
/* 3F88A4 E01104B4 24C60008 */  addiu     $a2, $a2, 0x8
/* 3F88A8 E01104B8 E7A00014 */  swc1      $f0, 0x14($sp)
/* 3F88AC E01104BC C6800008 */  lwc1      $f0, 0x8($s4)
/* 3F88B0 E01104C0 46001087 */  neg.s     $f2, $f2
/* 3F88B4 E01104C4 AEA60000 */  sw        $a2, 0x0($s5)
/* 3F88B8 E01104C8 44061000 */  mfc1      $a2, $f2
/* 3F88BC E01104CC 3C120001 */  lui       $s2, (0x11630 >> 16)
/* 3F88C0 E01104D0 E7A00018 */  swc1      $f0, 0x18($sp)
/* 3F88C4 E01104D4 C680000C */  lwc1      $f0, 0xC($s4)
/* 3F88C8 E01104D8 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* 3F88CC E01104DC 0C080180 */  jal       shim_guPositionF
/* 3F88D0 E01104E0 E7A0001C */   swc1     $f0, 0x1C($sp)
/* 3F88D4 E01104E4 27A40020 */  addiu     $a0, $sp, 0x20
/* 3F88D8 E01104E8 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 3F88DC E01104EC 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 3F88E0 E01104F0 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* 3F88E4 E01104F4 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* 3F88E8 E01104F8 96050000 */  lhu       $a1, 0x0($s0)
/* 3F88EC E01104FC 8E220000 */  lw        $v0, 0x0($s1)
/* 3F88F0 E0110500 00052980 */  sll       $a1, $a1, 6
/* 3F88F4 E0110504 00B22821 */  addu      $a1, $a1, $s2
/* 3F88F8 E0110508 0C080118 */  jal       shim_guMtxF2L
/* 3F88FC E011050C 00452821 */   addu     $a1, $v0, $a1
/* 3F8900 E0110510 3C02DA38 */  lui       $v0, (0xDA380002 >> 16)
/* 3F8904 E0110514 34420002 */  ori       $v0, $v0, (0xDA380002 & 0xFFFF)
/* 3F8908 E0110518 27A40020 */  addiu     $a0, $sp, 0x20
/* 3F890C E011051C 8EA90000 */  lw        $t1, 0x0($s5)
/* 3F8910 E0110520 4406A000 */  mfc1      $a2, $f20
/* 3F8914 E0110524 96080000 */  lhu       $t0, 0x0($s0)
/* 3F8918 E0110528 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3F891C E011052C 44810000 */  mtc1      $at, $f0
/* 3F8920 E0110530 00C0382D */  daddu     $a3, $a2, $zero
/* 3F8924 E0110534 0120282D */  daddu     $a1, $t1, $zero
/* 3F8928 E0110538 3103FFFF */  andi      $v1, $t0, 0xFFFF
/* 3F892C E011053C 00031980 */  sll       $v1, $v1, 6
/* 3F8930 E0110540 00721821 */  addu      $v1, $v1, $s2
/* 3F8934 E0110544 ACA20000 */  sw        $v0, 0x0($a1)
/* 3F8938 E0110548 8E220000 */  lw        $v0, 0x0($s1)
/* 3F893C E011054C 25290008 */  addiu     $t1, $t1, 0x8
/* 3F8940 E0110550 00431021 */  addu      $v0, $v0, $v1
/* 3F8944 E0110554 ACA20004 */  sw        $v0, 0x4($a1)
/* 3F8948 E0110558 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3F894C E011055C 8E85003C */  lw        $a1, 0x3C($s4)
/* 3F8950 E0110560 25080001 */  addiu     $t0, $t0, 0x1
/* 3F8954 E0110564 AEA90000 */  sw        $t1, 0x0($s5)
/* 3F8958 E0110568 0C080104 */  jal       shim_guRotateF
/* 3F895C E011056C A6080000 */   sh       $t0, 0x0($s0)
/* 3F8960 E0110570 27A40020 */  addiu     $a0, $sp, 0x20
/* 3F8964 E0110574 96050000 */  lhu       $a1, 0x0($s0)
/* 3F8968 E0110578 8E220000 */  lw        $v0, 0x0($s1)
/* 3F896C E011057C 00052980 */  sll       $a1, $a1, 6
/* 3F8970 E0110580 00B22821 */  addu      $a1, $a1, $s2
/* 3F8974 E0110584 0C080118 */  jal       shim_guMtxF2L
/* 3F8978 E0110588 00452821 */   addu     $a1, $v0, $a1
/* 3F897C E011058C 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 3F8980 E0110590 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 3F8984 E0110594 3C0BDE00 */  lui       $t3, (0xDE000000 >> 16)
/* 3F8988 E0110598 3C0CFA00 */  lui       $t4, (0xFA000000 >> 16)
/* 3F898C E011059C 8EA90000 */  lw        $t1, 0x0($s5)
/* 3F8990 E01105A0 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3F8994 E01105A4 44812000 */  mtc1      $at, $f4
/* 3F8998 E01105A8 0120202D */  daddu     $a0, $t1, $zero
/* 3F899C E01105AC 25290008 */  addiu     $t1, $t1, 0x8
/* 3F89A0 E01105B0 AEA90000 */  sw        $t1, 0x0($s5)
/* 3F89A4 E01105B4 96020000 */  lhu       $v0, 0x0($s0)
/* 3F89A8 E01105B8 3C06F200 */  lui       $a2, (0xF2000000 >> 16)
/* 3F89AC E01105BC AC830000 */  sw        $v1, 0x0($a0)
/* 3F89B0 E01105C0 24430001 */  addiu     $v1, $v0, 0x1
/* 3F89B4 E01105C4 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3F89B8 E01105C8 00021180 */  sll       $v0, $v0, 6
/* 3F89BC E01105CC A6030000 */  sh        $v1, 0x0($s0)
/* 3F89C0 E01105D0 8E230000 */  lw        $v1, 0x0($s1)
/* 3F89C4 E01105D4 00521021 */  addu      $v0, $v0, $s2
/* 3F89C8 E01105D8 00621821 */  addu      $v1, $v1, $v0
/* 3F89CC E01105DC 25220008 */  addiu     $v0, $t1, 0x8
/* 3F89D0 E01105E0 AC830004 */  sw        $v1, 0x4($a0)
/* 3F89D4 E01105E4 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F89D8 E01105E8 25220010 */  addiu     $v0, $t1, 0x10
/* 3F89DC E01105EC AD2B0000 */  sw        $t3, 0x0($t1)
/* 3F89E0 E01105F0 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F89E4 E01105F4 25220018 */  addiu     $v0, $t1, 0x18
/* 3F89E8 E01105F8 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F89EC E01105FC 3C03E011 */  lui       $v1, (0xE01108B4 >> 16)
/* 3F89F0 E0110600 8C6308B4 */  lw        $v1, (0xE01108B4 & 0xFFFF)($v1)
/* 3F89F4 E0110604 25220020 */  addiu     $v0, $t1, 0x20
/* 3F89F8 E0110608 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F89FC E011060C 001317C2 */  srl       $v0, $s3, 31
/* 3F8A00 E0110610 02621021 */  addu      $v0, $s3, $v0
/* 3F8A04 E0110614 00021043 */  sra       $v0, $v0, 1
/* 3F8A08 E0110618 00021040 */  sll       $v0, $v0, 1
/* 3F8A0C E011061C 02629823 */  subu      $s3, $s3, $v0
/* 3F8A10 E0110620 001329C0 */  sll       $a1, $s3, 7
/* 3F8A14 E0110624 30A50FFF */  andi      $a1, $a1, 0xFFF
/* 3F8A18 E0110628 00052B00 */  sll       $a1, $a1, 12
/* 3F8A1C E011062C AD230004 */  sw        $v1, 0x4($t1)
/* 3F8A20 E0110630 C6800044 */  lwc1      $f0, 0x44($s4)
/* 3F8A24 E0110634 001319C0 */  sll       $v1, $s3, 7
/* 3F8A28 E0110638 46040082 */  mul.s     $f2, $f0, $f4
/* 3F8A2C E011063C 00000000 */  nop
/* 3F8A30 E0110640 3463007C */  ori       $v1, $v1, 0x7C
/* 3F8A34 E0110644 30630FFF */  andi      $v1, $v1, 0xFFF
/* 3F8A38 E0110648 00031B00 */  sll       $v1, $v1, 12
/* 3F8A3C E011064C AD2C0018 */  sw        $t4, 0x18($t1)
/* 3F8A40 E0110650 4600118D */  trunc.w.s $f6, $f2
/* 3F8A44 E0110654 44043000 */  mfc1      $a0, $f6
/* 3F8A48 E0110658 00000000 */  nop
/* 3F8A4C E011065C 000411C0 */  sll       $v0, $a0, 7
/* 3F8A50 E0110660 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3F8A54 E0110664 00461025 */  or        $v0, $v0, $a2
/* 3F8A58 E0110668 00A21025 */  or        $v0, $a1, $v0
/* 3F8A5C E011066C 00042140 */  sll       $a0, $a0, 5
/* 3F8A60 E0110670 AD220008 */  sw        $v0, 0x8($t1)
/* 3F8A64 E0110674 2482001F */  addiu     $v0, $a0, 0x1F
/* 3F8A68 E0110678 00021080 */  sll       $v0, $v0, 2
/* 3F8A6C E011067C 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3F8A70 E0110680 00621025 */  or        $v0, $v1, $v0
/* 3F8A74 E0110684 AD22000C */  sw        $v0, 0xC($t1)
/* 3F8A78 E0110688 24820020 */  addiu     $v0, $a0, 0x20
/* 3F8A7C E011068C 00021080 */  sll       $v0, $v0, 2
/* 3F8A80 E0110690 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3F8A84 E0110694 00461025 */  or        $v0, $v0, $a2
/* 3F8A88 E0110698 00A22825 */  or        $a1, $a1, $v0
/* 3F8A8C E011069C 2484003F */  addiu     $a0, $a0, 0x3F
/* 3F8A90 E01106A0 00042080 */  sll       $a0, $a0, 2
/* 3F8A94 E01106A4 30840FFF */  andi      $a0, $a0, 0xFFF
/* 3F8A98 E01106A8 3C020100 */  lui       $v0, (0x1000000 >> 16)
/* 3F8A9C E01106AC 00822025 */  or        $a0, $a0, $v0
/* 3F8AA0 E01106B0 00641825 */  or        $v1, $v1, $a0
/* 3F8AA4 E01106B4 AD250010 */  sw        $a1, 0x10($t1)
/* 3F8AA8 E01106B8 AD230014 */  sw        $v1, 0x14($t1)
/* 3F8AAC E01106BC 9283001B */  lbu       $v1, 0x1B($s4)
/* 3F8AB0 E01106C0 9284001F */  lbu       $a0, 0x1F($s4)
/* 3F8AB4 E01106C4 92850023 */  lbu       $a1, 0x23($s4)
/* 3F8AB8 E01106C8 25220028 */  addiu     $v0, $t1, 0x28
/* 3F8ABC E01106CC AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8AC0 E01106D0 3C02FB00 */  lui       $v0, (0xFB000000 >> 16)
/* 3F8AC4 E01106D4 AD220020 */  sw        $v0, 0x20($t1)
/* 3F8AC8 E01106D8 4600018D */  trunc.w.s $f6, $f0
/* 3F8ACC E01106DC 44023000 */  mfc1      $v0, $f6
/* 3F8AD0 E01106E0 00000000 */  nop
/* 3F8AD4 E01106E4 00021080 */  sll       $v0, $v0, 2
/* 3F8AD8 E01106E8 44820000 */  mtc1      $v0, $f0
/* 3F8ADC E01106EC 00000000 */  nop
/* 3F8AE0 E01106F0 46800020 */  cvt.s.w   $f0, $f0
/* 3F8AE4 E01106F4 32C200FF */  andi      $v0, $s6, 0xFF
/* 3F8AE8 E01106F8 46001081 */  sub.s     $f2, $f2, $f0
/* 3F8AEC E01106FC 3C014380 */  lui       $at, (0x43800000 >> 16)
/* 3F8AF0 E0110700 44810000 */  mtc1      $at, $f0
/* 3F8AF4 E0110704 00031E00 */  sll       $v1, $v1, 24
/* 3F8AF8 E0110708 00042400 */  sll       $a0, $a0, 16
/* 3F8AFC E011070C 00641825 */  or        $v1, $v1, $a0
/* 3F8B00 E0110710 00052A00 */  sll       $a1, $a1, 8
/* 3F8B04 E0110714 00651825 */  or        $v1, $v1, $a1
/* 3F8B08 E0110718 00621825 */  or        $v1, $v1, $v0
/* 3F8B0C E011071C AD23001C */  sw        $v1, 0x1C($t1)
/* 3F8B10 E0110720 9282002B */  lbu       $v0, 0x2B($s4)
/* 3F8B14 E0110724 9283002F */  lbu       $v1, 0x2F($s4)
/* 3F8B18 E0110728 92840033 */  lbu       $a0, 0x33($s4)
/* 3F8B1C E011072C 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 3F8B20 E0110730 AD2B0028 */  sw        $t3, 0x28($t1)
/* 3F8B24 E0110734 00021600 */  sll       $v0, $v0, 24
/* 3F8B28 E0110738 46001082 */  mul.s     $f2, $f2, $f0
/* 3F8B2C E011073C 00000000 */  nop
/* 3F8B30 E0110740 00031C00 */  sll       $v1, $v1, 16
/* 3F8B34 E0110744 00431025 */  or        $v0, $v0, $v1
/* 3F8B38 E0110748 00042200 */  sll       $a0, $a0, 8
/* 3F8B3C E011074C 00441025 */  or        $v0, $v0, $a0
/* 3F8B40 E0110750 4600118D */  trunc.w.s $f6, $f2
/* 3F8B44 E0110754 440A3000 */  mfc1      $t2, $f6
/* 3F8B48 E0110758 00000000 */  nop
/* 3F8B4C E011075C 314300FF */  andi      $v1, $t2, 0xFF
/* 3F8B50 E0110760 00431025 */  or        $v0, $v0, $v1
/* 3F8B54 E0110764 AD220024 */  sw        $v0, 0x24($t1)
/* 3F8B58 E0110768 3C03E011 */  lui       $v1, (0xE01108B0 >> 16)
/* 3F8B5C E011076C 8C6308B0 */  lw        $v1, (0xE01108B0 & 0xFFFF)($v1)
/* 3F8B60 E0110770 25220030 */  addiu     $v0, $t1, 0x30
/* 3F8B64 E0110774 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8B68 E0110778 25220038 */  addiu     $v0, $t1, 0x38
/* 3F8B6C E011077C AD23002C */  sw        $v1, 0x2C($t1)
/* 3F8B70 E0110780 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8B74 E0110784 24020040 */  addiu     $v0, $zero, 0x40
/* 3F8B78 E0110788 AD220034 */  sw        $v0, 0x34($t1)
/* 3F8B7C E011078C 24020001 */  addiu     $v0, $zero, 0x1
/* 3F8B80 E0110790 16620030 */  bne       $s3, $v0, .LE0110854
/* 3F8B84 E0110794 AD270030 */   sw       $a3, 0x30($t1)
/* 3F8B88 E0110798 C6800044 */  lwc1      $f0, 0x44($s4)
/* 3F8B8C E011079C 46040002 */  mul.s     $f0, $f0, $f4
/* 3F8B90 E01107A0 00000000 */  nop
/* 3F8B94 E01107A4 24020003 */  addiu     $v0, $zero, 0x3
/* 3F8B98 E01107A8 4600018D */  trunc.w.s $f6, $f0
/* 3F8B9C E01107AC 44033000 */  mfc1      $v1, $f6
/* 3F8BA0 E01107B0 00000000 */  nop
/* 3F8BA4 E01107B4 14620028 */  bne       $v1, $v0, .LE0110858
/* 3F8BA8 E01107B8 3C05D838 */   lui      $a1, (0xD8380002 >> 16)
/* 3F8BAC E01107BC 3C088080 */  lui       $t0, (0x80808081 >> 16)
/* 3F8BB0 E01107C0 35088081 */  ori       $t0, $t0, (0x80808081 & 0xFFFF)
/* 3F8BB4 E01107C4 3C07FCFF */  lui       $a3, (0xFCFFC7FF >> 16)
/* 3F8BB8 E01107C8 34E7C7FF */  ori       $a3, $a3, (0xFCFFC7FF & 0xFFFF)
/* 3F8BBC E01107CC 3C04FF8D */  lui       $a0, (0xFF8DFEFF >> 16)
/* 3F8BC0 E01107D0 3484FEFF */  ori       $a0, $a0, (0xFF8DFEFF & 0xFFFF)
/* 3F8BC4 E01107D4 25220040 */  addiu     $v0, $t1, 0x40
/* 3F8BC8 E01107D8 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8BCC E01107DC AD2C0038 */  sw        $t4, 0x38($t1)
/* 3F8BD0 E01107E0 9283001B */  lbu       $v1, 0x1B($s4)
/* 3F8BD4 E01107E4 9285001F */  lbu       $a1, 0x1F($s4)
/* 3F8BD8 E01107E8 92860023 */  lbu       $a2, 0x23($s4)
/* 3F8BDC E01107EC 25220048 */  addiu     $v0, $t1, 0x48
/* 3F8BE0 E01107F0 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8BE4 E01107F4 25220050 */  addiu     $v0, $t1, 0x50
/* 3F8BE8 E01107F8 02CA0018 */  mult      $s6, $t2
/* 3F8BEC E01107FC AD270040 */  sw        $a3, 0x40($t1)
/* 3F8BF0 E0110800 AD240044 */  sw        $a0, 0x44($t1)
/* 3F8BF4 E0110804 AEA20000 */  sw        $v0, 0x0($s5)
/* 3F8BF8 E0110808 3C020900 */  lui       $v0, %hi(D_09001168_40E3F8)
/* 3F8BFC E011080C 24421168 */  addiu     $v0, $v0, %lo(D_09001168_40E3F8)
/* 3F8C00 E0110810 AD2B0048 */  sw        $t3, 0x48($t1)
/* 3F8C04 E0110814 00002012 */  mflo      $a0
/* 3F8C08 E0110818 AD22004C */  sw        $v0, 0x4C($t1)
/* 3F8C0C E011081C 00031E00 */  sll       $v1, $v1, 24
/* 3F8C10 E0110820 00880018 */  mult      $a0, $t0
/* 3F8C14 E0110824 00052C00 */  sll       $a1, $a1, 16
/* 3F8C18 E0110828 00651825 */  or        $v1, $v1, $a1
/* 3F8C1C E011082C 00063200 */  sll       $a2, $a2, 8
/* 3F8C20 E0110830 00661825 */  or        $v1, $v1, $a2
/* 3F8C24 E0110834 00001010 */  mfhi      $v0
/* 3F8C28 E0110838 00441021 */  addu      $v0, $v0, $a0
/* 3F8C2C E011083C 000211C3 */  sra       $v0, $v0, 7
/* 3F8C30 E0110840 000427C3 */  sra       $a0, $a0, 31
/* 3F8C34 E0110844 00441023 */  subu      $v0, $v0, $a0
/* 3F8C38 E0110848 304200FF */  andi      $v0, $v0, 0xFF
/* 3F8C3C E011084C 00621825 */  or        $v1, $v1, $v0
/* 3F8C40 E0110850 AD23003C */  sw        $v1, 0x3C($t1)
.LE0110854:
/* 3F8C44 E0110854 3C05D838 */  lui       $a1, (0xD8380002 >> 16)
.LE0110858:
/* 3F8C48 E0110858 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 3F8C4C E011085C 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 3F8C50 E0110860 8C620000 */  lw        $v0, 0x0($v1)
/* 3F8C54 E0110864 34A50002 */  ori       $a1, $a1, (0xD8380002 & 0xFFFF)
/* 3F8C58 E0110868 0040202D */  daddu     $a0, $v0, $zero
/* 3F8C5C E011086C 24420008 */  addiu     $v0, $v0, 0x8
/* 3F8C60 E0110870 AC620000 */  sw        $v0, 0x0($v1)
/* 3F8C64 E0110874 24020040 */  addiu     $v0, $zero, 0x40
/* 3F8C68 E0110878 AC850000 */  sw        $a1, 0x0($a0)
/* 3F8C6C E011087C AC820004 */  sw        $v0, 0x4($a0)
/* 3F8C70 E0110880 8FBF00BC */  lw        $ra, 0xBC($sp)
/* 3F8C74 E0110884 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 3F8C78 E0110888 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 3F8C7C E011088C 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 3F8C80 E0110890 8FB300AC */  lw        $s3, 0xAC($sp)
/* 3F8C84 E0110894 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 3F8C88 E0110898 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 3F8C8C E011089C 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 3F8C90 E01108A0 D7B400C0 */  ldc1      $f20, 0xC0($sp)
/* 3F8C94 E01108A4 03E00008 */  jr        $ra
/* 3F8C98 E01108A8 27BD00C8 */   addiu    $sp, $sp, 0xC8
/* 3F8C9C E01108AC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void ice_shard_appendGfx(void* effect) {
    IceShardFXData* data = ((EffectInstance*)effect)->data.iceShard;
    s32 alpha = data->primCol.a;
    s32 type = data->type;
    s32 texCoordS;
    s32 texCoordT;
    s32 envAlpha;
    Matrix4f sp20;
    Matrix4f unused;

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

    shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

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

    shim_guRotateF(sp20, data->rotation, 0.0f, 0.0f, 1.0f);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gSPDisplayList(gMainGfxPos++, D_E01108B4[0]);

    texCoordS = (type % 2) * 32;
    texCoordT = (s32) (data->animFrame * 4.0f) * 32;
    envAlpha = (data->animFrame * 4.0f - (s32) data->animFrame * 4) * 256.0f;

    gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
        (texCoordS     ) * 4, (texCoordT     ) * 4,
        (texCoordS + 31) * 4, (texCoordT + 31) * 4);
    gDPSetTileSize(gMainGfxPos++, 1,
        (texCoordS     ) * 4, (texCoordT + 32) * 4,
        (texCoordS + 31) * 4, (texCoordT + 63) * 4);

    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, alpha);
    gDPSetEnvColor(gMainGfxPos++, data->envCol.r, data->envCol.g, data->envCol.b, envAlpha);
    gSPDisplayList(gMainGfxPos++, D_E01108B0[0]);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);

    if (type % 2 == 1 && (s32) (data->animFrame * 4.0f) == 3) {
        gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, alpha * envAlpha / 255);
        gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0);
        gSPDisplayList(gMainGfxPos++, D_09001168_3F9E28);
    }

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_player_spin
/* 7ABB4 800E1704 27BDFE80 */  addiu     $sp, $sp, -0x180
/* 7ABB8 800E1708 F7B60158 */  sdc1      $f22, 0x158($sp)
/* 7ABBC 800E170C 4480B000 */  mtc1      $zero, $f22
/* 7ABC0 800E1710 AFB10134 */  sw        $s1, 0x134($sp)
/* 7ABC4 800E1714 3C118011 */  lui       $s1, %hi(gPlayerStatus)
/* 7ABC8 800E1718 2631EFC8 */  addiu     $s1, $s1, %lo(gPlayerStatus)
/* 7ABCC 800E171C AFB3013C */  sw        $s3, 0x13C($sp)
/* 7ABD0 800E1720 0000982D */  daddu     $s3, $zero, $zero
/* 7ABD4 800E1724 AFB60148 */  sw        $s6, 0x148($sp)
/* 7ABD8 800E1728 3C16800B */  lui       $s6, %hi(gCameras)
/* 7ABDC 800E172C 26D61D80 */  addiu     $s6, $s6, %lo(gCameras)
/* 7ABE0 800E1730 AFB50144 */  sw        $s5, 0x144($sp)
/* 7ABE4 800E1734 241500FF */  addiu     $s5, $zero, 0xFF
/* 7ABE8 800E1738 AFB00130 */  sw        $s0, 0x130($sp)
/* 7ABEC 800E173C 27B000A0 */  addiu     $s0, $sp, 0xA0
/* 7ABF0 800E1740 AFB20138 */  sw        $s2, 0x138($sp)
/* 7ABF4 800E1744 27B20060 */  addiu     $s2, $sp, 0x60
/* 7ABF8 800E1748 AFB40140 */  sw        $s4, 0x140($sp)
/* 7ABFC 800E174C 27B400E0 */  addiu     $s4, $sp, 0xE0
/* 7AC00 800E1750 AFBF014C */  sw        $ra, 0x14C($sp)
/* 7AC04 800E1754 F7BE0178 */  sdc1      $f30, 0x178($sp)
/* 7AC08 800E1758 F7BC0170 */  sdc1      $f28, 0x170($sp)
/* 7AC0C 800E175C F7BA0168 */  sdc1      $f26, 0x168($sp)
/* 7AC10 800E1760 F7B80160 */  sdc1      $f24, 0x160($sp)
/* 7AC14 800E1764 F7B40150 */  sdc1      $f20, 0x150($sp)
.L800E1768:
/* 7AC18 800E1768 3C03800A */  lui       $v1, %hi(gCurrentCamID)
/* 7AC1C 800E176C 8463A634 */  lh        $v1, %lo(gCurrentCamID)($v1)
/* 7AC20 800E1770 00031080 */  sll       $v0, $v1, 2
/* 7AC24 800E1774 00431021 */  addu      $v0, $v0, $v1
/* 7AC28 800E1778 00021080 */  sll       $v0, $v0, 2
/* 7AC2C 800E177C 00431023 */  subu      $v0, $v0, $v1
/* 7AC30 800E1780 000218C0 */  sll       $v1, $v0, 3
/* 7AC34 800E1784 00431021 */  addu      $v0, $v0, $v1
/* 7AC38 800E1788 000210C0 */  sll       $v0, $v0, 3
/* 7AC3C 800E178C 00561021 */  addu      $v0, $v0, $s6
/* 7AC40 800E1790 C440006C */  lwc1      $f0, 0x6C($v0)
/* 7AC44 800E1794 16600064 */  bnez      $s3, .L800E1928
/* 7AC48 800E1798 46000507 */   neg.s    $f20, $f0
/* 7AC4C 800E179C C62200A8 */  lwc1      $f2, 0xA8($s1)
/* 7AC50 800E17A0 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 7AC54 800E17A4 44810000 */  mtc1      $at, $f0
/* 7AC58 800E17A8 00000000 */  nop
/* 7AC5C 800E17AC 4602003C */  c.lt.s    $f0, $f2
/* 7AC60 800E17B0 00000000 */  nop
/* 7AC64 800E17B4 4500000A */  bc1f      .L800E17E0
/* 7AC68 800E17B8 00000000 */   nop
/* 7AC6C 800E17BC 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 7AC70 800E17C0 44812000 */  mtc1      $at, $f4
/* 7AC74 800E17C4 00000000 */  nop
/* 7AC78 800E17C8 4604103E */  c.le.s    $f2, $f4
/* 7AC7C 800E17CC 00000000 */  nop
/* 7AC80 800E17D0 45000003 */  bc1f      .L800E17E0
/* 7AC84 800E17D4 00000000 */   nop
/* 7AC88 800E17D8 0803861C */  j         .L800E1870
/* 7AC8C 800E17DC 46022501 */   sub.s    $f20, $f4, $f2
.L800E17E0:
/* 7AC90 800E17E0 C62000A8 */  lwc1      $f0, 0xA8($s1)
/* 7AC94 800E17E4 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 7AC98 800E17E8 44812000 */  mtc1      $at, $f4
/* 7AC9C 800E17EC 00000000 */  nop
/* 7ACA0 800E17F0 4600203C */  c.lt.s    $f4, $f0
/* 7ACA4 800E17F4 00000000 */  nop
/* 7ACA8 800E17F8 4500000C */  bc1f      .L800E182C
/* 7ACAC 800E17FC 00000000 */   nop
/* 7ACB0 800E1800 3C014387 */  lui       $at, (0x43870000 >> 16)
/* 7ACB4 800E1804 44812000 */  mtc1      $at, $f4
/* 7ACB8 800E1808 00000000 */  nop
/* 7ACBC 800E180C 4604003E */  c.le.s    $f0, $f4
/* 7ACC0 800E1810 00000000 */  nop
/* 7ACC4 800E1814 45000008 */  bc1f      .L800E1838
/* 7ACC8 800E1818 00000000 */   nop
/* 7ACCC 800E181C 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 7ACD0 800E1820 44812000 */  mtc1      $at, $f4
/* 7ACD4 800E1824 0803861C */  j         .L800E1870
/* 7ACD8 800E1828 46040501 */   sub.s    $f20, $f0, $f4
.L800E182C:
/* 7ACDC 800E182C 3C014387 */  lui       $at, (0x43870000 >> 16)
/* 7ACE0 800E1830 44812000 */  mtc1      $at, $f4
/* 7ACE4 800E1834 00000000 */  nop
.L800E1838:
/* 7ACE8 800E1838 4600203C */  c.lt.s    $f4, $f0
/* 7ACEC 800E183C 00000000 */  nop
/* 7ACF0 800E1840 4500000A */  bc1f      .L800E186C
/* 7ACF4 800E1844 00000000 */   nop
/* 7ACF8 800E1848 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 7ACFC 800E184C 44811000 */  mtc1      $at, $f2
/* 7AD00 800E1850 00000000 */  nop
/* 7AD04 800E1854 4602003E */  c.le.s    $f0, $f2
/* 7AD08 800E1858 00000000 */  nop
/* 7AD0C 800E185C 45000003 */  bc1f      .L800E186C
/* 7AD10 800E1860 00000000 */   nop
/* 7AD14 800E1864 0803861C */  j         .L800E1870
/* 7AD18 800E1868 46001501 */   sub.s    $f20, $f2, $f0
.L800E186C:
/* 7AD1C 800E186C C63400A8 */  lwc1      $f20, 0xA8($s1)
.L800E1870:
/* 7AD20 800E1870 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 7AD24 800E1874 44810000 */  mtc1      $at, $f0
/* 7AD28 800E1878 00000000 */  nop
/* 7AD2C 800E187C 4600A003 */  div.s     $f0, $f20, $f0
/* 7AD30 800E1880 4600010D */  trunc.w.s $f4, $f0
/* 7AD34 800E1884 44062000 */  mfc1      $a2, $f4
/* 7AD38 800E1888 00000000 */  nop
/* 7AD3C 800E188C 00061100 */  sll       $v0, $a2, 4
/* 7AD40 800E1890 00461023 */  subu      $v0, $v0, $a2
/* 7AD44 800E1894 00021080 */  sll       $v0, $v0, 2
/* 7AD48 800E1898 02A23023 */  subu      $a2, $s5, $v0
/* 7AD4C 800E189C 28C20064 */  slti      $v0, $a2, 0x64
/* 7AD50 800E18A0 54400001 */  bnel      $v0, $zero, .L800E18A8
/* 7AD54 800E18A4 24060064 */   addiu    $a2, $zero, 0x64
.L800E18A8:
/* 7AD58 800E18A8 0000202D */  daddu     $a0, $zero, $zero
/* 7AD5C 800E18AC 24050006 */  addiu     $a1, $zero, 0x6
/* 7AD60 800E18B0 00C0382D */  daddu     $a3, $a2, $zero
/* 7AD64 800E18B4 AFA60010 */  sw        $a2, 0x10($sp)
/* 7AD68 800E18B8 AFB50014 */  sw        $s5, 0x14($sp)
/* 7AD6C 800E18BC 0C0B77FE */  jal       set_player_imgfx_all
/* 7AD70 800E18C0 AFA00018 */   sw       $zero, 0x18($sp)
/* 7AD74 800E18C4 4405A000 */  mfc1      $a1, $f20
/* 7AD78 800E18C8 4406B000 */  mfc1      $a2, $f22
/* 7AD7C 800E18CC 3C07BF80 */  lui       $a3, (0xBF800000 >> 16)
/* 7AD80 800E18D0 0200202D */  daddu     $a0, $s0, $zero
/* 7AD84 800E18D4 0C019EC8 */  jal       guRotateF
/* 7AD88 800E18D8 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AD8C 800E18DC C62C008C */  lwc1      $f12, 0x8C($s1)
/* 7AD90 800E18E0 0C00A6C9 */  jal       clamp_angle
/* 7AD94 800E18E4 00000000 */   nop
/* 7AD98 800E18E8 44050000 */  mfc1      $a1, $f0
/* 7AD9C 800E18EC 4406B000 */  mfc1      $a2, $f22
/* 7ADA0 800E18F0 4407B000 */  mfc1      $a3, $f22
/* 7ADA4 800E18F4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 7ADA8 800E18F8 44812000 */  mtc1      $at, $f4
/* 7ADAC 800E18FC 27A40020 */  addiu     $a0, $sp, 0x20
/* 7ADB0 800E1900 0C019EC8 */  jal       guRotateF
/* 7ADB4 800E1904 E7A40010 */   swc1     $f4, 0x10($sp)
/* 7ADB8 800E1908 0200202D */  daddu     $a0, $s0, $zero
/* 7ADBC 800E190C 27A50020 */  addiu     $a1, $sp, 0x20
/* 7ADC0 800E1910 0C019D80 */  jal       guMtxCatF
/* 7ADC4 800E1914 00A0302D */   daddu    $a2, $a1, $zero
/* 7ADC8 800E1918 C63E0028 */  lwc1      $f30, 0x28($s1)
/* 7ADCC 800E191C C638002C */  lwc1      $f24, 0x2C($s1)
/* 7ADD0 800E1920 0803867B */  j         .L800E19EC
/* 7ADD4 800E1924 C63C0030 */   lwc1     $f28, 0x30($s1)
.L800E1928:
/* 7ADD8 800E1928 0260202D */  daddu     $a0, $s3, $zero
/* 7ADDC 800E192C 27A50120 */  addiu     $a1, $sp, 0x120
/* 7ADE0 800E1930 27A60124 */  addiu     $a2, $sp, 0x124
/* 7ADE4 800E1934 0C03964E */  jal       phys_get_spin_history
/* 7ADE8 800E1938 27A70128 */   addiu    $a3, $sp, 0x128
/* 7ADEC 800E193C 8FA60124 */  lw        $a2, 0x124($sp)
/* 7ADF0 800E1940 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 7ADF4 800E1944 14C20004 */  bne       $a2, $v0, .L800E1958
/* 7ADF8 800E1948 46000686 */   mov.s    $f26, $f0
/* 7ADFC 800E194C C638002C */  lwc1      $f24, 0x2C($s1)
/* 7AE00 800E1950 0803865A */  j         .L800E1968
/* 7AE04 800E1954 0000202D */   daddu    $a0, $zero, $zero
.L800E1958:
/* 7AE08 800E1958 4486C000 */  mtc1      $a2, $f24
/* 7AE0C 800E195C 00000000 */  nop
/* 7AE10 800E1960 4680C620 */  cvt.s.w   $f24, $f24
/* 7AE14 800E1964 0000202D */  daddu     $a0, $zero, $zero
.L800E1968:
/* 7AE18 800E1968 2405FFFF */  addiu     $a1, $zero, -0x1
/* 7AE1C 800E196C 24060007 */  addiu     $a2, $zero, 0x7
/* 7AE20 800E1970 0080382D */  daddu     $a3, $a0, $zero
/* 7AE24 800E1974 C63E0028 */  lwc1      $f30, 0x28($s1)
/* 7AE28 800E1978 C63C0030 */  lwc1      $f28, 0x30($s1)
/* 7AE2C 800E197C 24020040 */  addiu     $v0, $zero, 0x40
/* 7AE30 800E1980 AFA00010 */  sw        $zero, 0x10($sp)
/* 7AE34 800E1984 AFA00014 */  sw        $zero, 0x14($sp)
/* 7AE38 800E1988 AFA20018 */  sw        $v0, 0x18($sp)
/* 7AE3C 800E198C 0C0B77B9 */  jal       set_player_imgfx_comp
/* 7AE40 800E1990 AFA0001C */   sw       $zero, 0x1C($sp)
/* 7AE44 800E1994 4405A000 */  mfc1      $a1, $f20
/* 7AE48 800E1998 4406B000 */  mfc1      $a2, $f22
/* 7AE4C 800E199C 3C07BF80 */  lui       $a3, (0xBF800000 >> 16)
/* 7AE50 800E19A0 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AE54 800E19A4 0C019EC8 */  jal       guRotateF
/* 7AE58 800E19A8 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AE5C 800E19AC 4405A000 */  mfc1      $a1, $f20
/* 7AE60 800E19B0 4406B000 */  mfc1      $a2, $f22
/* 7AE64 800E19B4 3C07BF80 */  lui       $a3, (0xBF800000 >> 16)
/* 7AE68 800E19B8 0200202D */  daddu     $a0, $s0, $zero
/* 7AE6C 800E19BC 0C019EC8 */  jal       guRotateF
/* 7AE70 800E19C0 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AE74 800E19C4 4405D000 */  mfc1      $a1, $f26
/* 7AE78 800E19C8 4406B000 */  mfc1      $a2, $f22
/* 7AE7C 800E19CC 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 7AE80 800E19D0 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AE84 800E19D4 0C019EC8 */  jal       guRotateF
/* 7AE88 800E19D8 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AE8C 800E19DC 0200202D */  daddu     $a0, $s0, $zero
/* 7AE90 800E19E0 27A50020 */  addiu     $a1, $sp, 0x20
/* 7AE94 800E19E4 0C019D80 */  jal       guMtxCatF
/* 7AE98 800E19E8 00A0302D */   daddu    $a2, $a1, $zero
.L800E19EC:
/* 7AE9C 800E19EC 862200B0 */  lh        $v0, 0xB0($s1)
/* 7AEA0 800E19F0 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 7AEA4 800E19F4 44812000 */  mtc1      $at, $f4
/* 7AEA8 800E19F8 00021023 */  negu      $v0, $v0
/* 7AEAC 800E19FC 44820000 */  mtc1      $v0, $f0
/* 7AEB0 800E1A00 00000000 */  nop
/* 7AEB4 800E1A04 46800020 */  cvt.s.w   $f0, $f0
/* 7AEB8 800E1A08 46040102 */  mul.s     $f4, $f0, $f4
/* 7AEBC 800E1A0C 00000000 */  nop
/* 7AEC0 800E1A10 4405B000 */  mfc1      $a1, $f22
/* 7AEC4 800E1A14 4407B000 */  mfc1      $a3, $f22
/* 7AEC8 800E1A18 44062000 */  mfc1      $a2, $f4
/* 7AECC 800E1A1C 0C019E40 */  jal       guTranslateF
/* 7AED0 800E1A20 0240202D */   daddu    $a0, $s2, $zero
/* 7AED4 800E1A24 0240202D */  daddu     $a0, $s2, $zero
/* 7AED8 800E1A28 27A50020 */  addiu     $a1, $sp, 0x20
/* 7AEDC 800E1A2C 0C019D80 */  jal       guMtxCatF
/* 7AEE0 800E1A30 00A0302D */   daddu    $a2, $a1, $zero
/* 7AEE4 800E1A34 4405A000 */  mfc1      $a1, $f20
/* 7AEE8 800E1A38 4406B000 */  mfc1      $a2, $f22
/* 7AEEC 800E1A3C 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 7AEF0 800E1A40 0200202D */  daddu     $a0, $s0, $zero
/* 7AEF4 800E1A44 0C019EC8 */  jal       guRotateF
/* 7AEF8 800E1A48 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AEFC 800E1A4C 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AF00 800E1A50 0200282D */  daddu     $a1, $s0, $zero
/* 7AF04 800E1A54 0C019D80 */  jal       guMtxCatF
/* 7AF08 800E1A58 0080302D */   daddu    $a2, $a0, $zero
/* 7AF0C 800E1A5C 8E2500A8 */  lw        $a1, 0xA8($s1)
/* 7AF10 800E1A60 4406B000 */  mfc1      $a2, $f22
/* 7AF14 800E1A64 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 7AF18 800E1A68 0200202D */  daddu     $a0, $s0, $zero
/* 7AF1C 800E1A6C 0C019EC8 */  jal       guRotateF
/* 7AF20 800E1A70 E7B60010 */   swc1     $f22, 0x10($sp)
/* 7AF24 800E1A74 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AF28 800E1A78 0200282D */  daddu     $a1, $s0, $zero
/* 7AF2C 800E1A7C 0C019D80 */  jal       guMtxCatF
/* 7AF30 800E1A80 0080302D */   daddu    $a2, $a0, $zero
/* 7AF34 800E1A84 862200B0 */  lh        $v0, 0xB0($s1)
/* 7AF38 800E1A88 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 7AF3C 800E1A8C 44812000 */  mtc1      $at, $f4
/* 7AF40 800E1A90 44820000 */  mtc1      $v0, $f0
/* 7AF44 800E1A94 00000000 */  nop
/* 7AF48 800E1A98 46800020 */  cvt.s.w   $f0, $f0
/* 7AF4C 800E1A9C 46040102 */  mul.s     $f4, $f0, $f4
/* 7AF50 800E1AA0 00000000 */  nop
/* 7AF54 800E1AA4 4405B000 */  mfc1      $a1, $f22
/* 7AF58 800E1AA8 4407B000 */  mfc1      $a3, $f22
/* 7AF5C 800E1AAC 44062000 */  mfc1      $a2, $f4
/* 7AF60 800E1AB0 0C019E40 */  jal       guTranslateF
/* 7AF64 800E1AB4 0240202D */   daddu    $a0, $s2, $zero
/* 7AF68 800E1AB8 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AF6C 800E1ABC 0240282D */  daddu     $a1, $s2, $zero
/* 7AF70 800E1AC0 0C019D80 */  jal       guMtxCatF
/* 7AF74 800E1AC4 0080302D */   daddu    $a2, $a0, $zero
/* 7AF78 800E1AC8 3C013F36 */  lui       $at, (0x3F36DB6E >> 16)
/* 7AF7C 800E1ACC 3421DB6E */  ori       $at, $at, (0x3F36DB6E & 0xFFFF)
/* 7AF80 800E1AD0 44810000 */  mtc1      $at, $f0
/* 7AF84 800E1AD4 00000000 */  nop
/* 7AF88 800E1AD8 44050000 */  mfc1      $a1, $f0
/* 7AF8C 800E1ADC 0280202D */  daddu     $a0, $s4, $zero
/* 7AF90 800E1AE0 00A0302D */  daddu     $a2, $a1, $zero
/* 7AF94 800E1AE4 0C019DF0 */  jal       guScaleF
/* 7AF98 800E1AE8 00A0382D */   daddu    $a3, $a1, $zero
/* 7AF9C 800E1AEC 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AFA0 800E1AF0 0280282D */  daddu     $a1, $s4, $zero
/* 7AFA4 800E1AF4 0C019D80 */  jal       guMtxCatF
/* 7AFA8 800E1AF8 0080302D */   daddu    $a2, $a0, $zero
/* 7AFAC 800E1AFC 4405F000 */  mfc1      $a1, $f30
/* 7AFB0 800E1B00 4406C000 */  mfc1      $a2, $f24
/* 7AFB4 800E1B04 4407E000 */  mfc1      $a3, $f28
/* 7AFB8 800E1B08 0C019E40 */  jal       guTranslateF
/* 7AFBC 800E1B0C 0240202D */   daddu    $a0, $s2, $zero
/* 7AFC0 800E1B10 27A40020 */  addiu     $a0, $sp, 0x20
/* 7AFC4 800E1B14 0240282D */  daddu     $a1, $s2, $zero
/* 7AFC8 800E1B18 0C019D80 */  jal       guMtxCatF
/* 7AFCC 800E1B1C 0080302D */   daddu    $a2, $a0, $zero
/* 7AFD0 800E1B20 C62200A8 */  lwc1      $f2, 0xA8($s1)
/* 7AFD4 800E1B24 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 7AFD8 800E1B28 44810000 */  mtc1      $at, $f0
/* 7AFDC 800E1B2C 00000000 */  nop
/* 7AFE0 800E1B30 4602003E */  c.le.s    $f0, $f2
/* 7AFE4 800E1B34 00000000 */  nop
/* 7AFE8 800E1B38 45000008 */  bc1f      .L800E1B5C
/* 7AFEC 800E1B3C 0000202D */   daddu    $a0, $zero, $zero
/* 7AFF0 800E1B40 3C014387 */  lui       $at, (0x43870000 >> 16)
/* 7AFF4 800E1B44 44812000 */  mtc1      $at, $f4
/* 7AFF8 800E1B48 00000000 */  nop
/* 7AFFC 800E1B4C 4604103C */  c.lt.s    $f2, $f4
/* 7B000 800E1B50 00000000 */  nop
/* 7B004 800E1B54 45030001 */  bc1tl     .L800E1B5C
/* 7B008 800E1B58 3C041000 */   lui      $a0, (0x10000000 >> 16)
.L800E1B5C:
/* 7B00C 800E1B5C 27A20020 */  addiu     $v0, $sp, 0x20
/* 7B010 800E1B60 AFA20010 */  sw        $v0, 0x10($sp)
/* 7B014 800E1B64 0000282D */  daddu     $a1, $zero, $zero
/* 7B018 800E1B68 00A0302D */  daddu     $a2, $a1, $zero
/* 7B01C 800E1B6C 0C0B7710 */  jal       spr_draw_player_sprite
/* 7B020 800E1B70 00A0382D */   daddu    $a3, $a1, $zero
/* 7B024 800E1B74 26730001 */  addiu     $s3, $s3, 0x1
/* 7B028 800E1B78 2A620002 */  slti      $v0, $s3, 0x2
/* 7B02C 800E1B7C 1440FEFA */  bnez      $v0, .L800E1768
/* 7B030 800E1B80 00000000 */   nop
/* 7B034 800E1B84 8FBF014C */  lw        $ra, 0x14C($sp)
/* 7B038 800E1B88 8FB60148 */  lw        $s6, 0x148($sp)
/* 7B03C 800E1B8C 8FB50144 */  lw        $s5, 0x144($sp)
/* 7B040 800E1B90 8FB40140 */  lw        $s4, 0x140($sp)
/* 7B044 800E1B94 8FB3013C */  lw        $s3, 0x13C($sp)
/* 7B048 800E1B98 8FB20138 */  lw        $s2, 0x138($sp)
/* 7B04C 800E1B9C 8FB10134 */  lw        $s1, 0x134($sp)
/* 7B050 800E1BA0 8FB00130 */  lw        $s0, 0x130($sp)
/* 7B054 800E1BA4 D7BE0178 */  ldc1      $f30, 0x178($sp)
/* 7B058 800E1BA8 D7BC0170 */  ldc1      $f28, 0x170($sp)
/* 7B05C 800E1BAC D7BA0168 */  ldc1      $f26, 0x168($sp)
/* 7B060 800E1BB0 D7B80160 */  ldc1      $f24, 0x160($sp)
/* 7B064 800E1BB4 D7B60158 */  ldc1      $f22, 0x158($sp)
/* 7B068 800E1BB8 D7B40150 */  ldc1      $f20, 0x150($sp)
/* 7B06C 800E1BBC 03E00008 */  jr        $ra
/* 7B070 800E1BC0 27BD0180 */   addiu    $sp, $sp, 0x180

### DECOMPILED C INSTRUCTIONS:

void appendGfx_player_spin(void* data) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    Matrix4f mtx;
    Matrix4f translation;
    Matrix4f rotation;
    Matrix4f scale;
    f32 yaw;
    f32 blurAngle;
    s32 tint;
    f32 px, py, pz;
    s32 x, y, z;
    s32 i;
    s32 spriteIdx;

    for (i = 0; i < 2; i++) {
        yaw = -gCameras[gCurrentCamID].currentYaw;

        if (i == 0) {
            if (playerStatus->spriteFacingAngle > 90.0f && playerStatus->spriteFacingAngle <= 180.0f) {
                yaw = 180.0f - playerStatus->spriteFacingAngle;
            } else {
                if (playerStatus->spriteFacingAngle > 180.0f && playerStatus->spriteFacingAngle <= 270.0f) {
                    yaw = playerStatus->spriteFacingAngle - 180.0f;
                } else if (playerStatus->spriteFacingAngle > 270.0f && playerStatus->spriteFacingAngle <= 360.0f) {
                    yaw = 360.0f - playerStatus->spriteFacingAngle;
                } else {
                    yaw = playerStatus->spriteFacingAngle;
                }
            }

            tint = yaw / 25.0f;
            tint = 255 - (tint * 60);
            if (tint < 100) {
                tint = 100;
            }

            set_player_imgfx_all(PLAYER_SPRITE_MAIN, IMGFX_SET_COLOR, tint, tint, tint, 255, 0);

            guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f);
            guRotateF(mtx, clamp_angle(playerStatus->pitch), 0.0f, 0.0f, 1.0f);
            guMtxCatF(rotation, mtx, mtx);
            px = playerStatus->position.x;
            py = playerStatus->position.y;
            pz = playerStatus->position.z;
        } else {
            blurAngle = phys_get_spin_history(i, &x, &y, &z);

            if (y == 0x80000000) {
                py = playerStatus->position.y;
            } else {
                py = y;
            }

            px = playerStatus->position.x;
            pz = playerStatus->position.z;
            set_player_imgfx_comp(PLAYER_SPRITE_MAIN, -1, IMGFX_SET_ALPHA, 0, 0, 0, 64, 0);
            guRotateF(mtx, yaw, 0.0f, -1.0f, 0.0f);
            guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f);
            guRotateF(mtx, blurAngle, 0.0f, 1.0f, 0.0f);
            guMtxCatF(rotation, mtx, mtx);
        }

        guTranslateF(translation, 0.0f, -playerStatus->colliderHeight * 0.5f, 0.0f);
        guMtxCatF(translation, mtx, mtx);
        guRotateF(rotation, yaw, 0.0f, 1.0f, 0.0f);
        guMtxCatF(mtx, rotation, mtx);
        guRotateF(rotation, playerStatus->spriteFacingAngle, 0.0f, 1.0f, 0.0f);
        guMtxCatF(mtx, rotation, mtx);
        guTranslateF(translation, 0.0f, playerStatus->colliderHeight * 0.5f, 0.0f);
        guMtxCatF(mtx, translation, mtx);
        guScaleF(scale, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D);
        guMtxCatF(mtx, scale, mtx);
        guTranslateF(translation, px, py, pz);
        guMtxCatF(mtx, translation, mtx);

        if (playerStatus->spriteFacingAngle >= 90.0f && playerStatus->spriteFacingAngle < 270.0f) {
            spriteIdx = PLAYER_SPRITE_MAIN | DRAW_SPRITE_UPSIDE_DOWN;
        } else {
            spriteIdx = PLAYER_SPRITE_MAIN;
        }

        spr_draw_player_sprite(spriteIdx, 0, 0, 0, mtx);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel D_80242BB0
/* 171490 80242BB0 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 171494 80242BB4 AFB20018 */  sw        $s2, 0x18($sp)
glabel func_80242BB8
/* 171498 80242BB8 3C12800E */  lui       $s2, %hi(gBattleStatus)
glabel func_80242BBC
/* 17149C 80242BBC 2652C070 */  addiu     $s2, $s2, %lo(gBattleStatus)
glabel func_80242BC0
/* 1714A0 80242BC0 AFB10014 */  sw        $s1, 0x14($sp)
glabel .L80242BC4
/* 1714A4 80242BC4 3C11800E */  lui       $s1, %hi(gBattleSubState)
glabel .L80242BC8
/* 1714A8 80242BC8 2631C4DC */  addiu     $s1, $s1, %lo(gBattleSubState)
.L80242BCC:
/* 1714AC 80242BCC AFBF0020 */  sw        $ra, 0x20($sp)
glabel func_80242BD0
/* 1714B0 80242BD0 AFB3001C */  sw        $s3, 0x1C($sp)
.L80242BD4:
/* 1714B4 80242BD4 AFB00010 */  sw        $s0, 0x10($sp)
glabel dead_kzn_17_LetterDelivery_CalcLetterPos
/* 1714B8 80242BD8 8E220000 */  lw        $v0, 0x0($s1)
.L80242BDC:
/* 1714BC 80242BDC 14400016 */  bnez      $v0, D_80242C38
D_80242BE0:
/* 1714C0 80242BE0 8E5000DC */   lw       $s0, 0xDC($s2)
.L80242BE4:
/* 1714C4 80242BE4 16000006 */  bnez      $s0, D_80242C00
.L80242BE8:
/* 1714C8 80242BE8 24030006 */   addiu    $v1, $zero, 0x6
D_80242BEC:
/* 1714CC 80242BEC 24020001 */  addiu     $v0, $zero, 0x1
D_80242BF0:
/* 1714D0 80242BF0 3C01802A */  lui       $at, %hi(D_8029F254)
flo_14_pad_2BF4:
/* 1714D4 80242BF4 AC22F254 */  sw        $v0, %lo(D_8029F254)($at)
D_80242BF8:
/* 1714D8 80242BF8 08090B0D */  j         .L80242C34
.L80242BFC:
/* 1714DC 80242BFC 2402000A */   addiu    $v0, $zero, 0xA
D_80242C00:
/* 1714E0 80242C00 8E420004 */  lw        $v0, 0x4($s2)
.L80242C04:
/* 1714E4 80242C04 30420006 */  andi      $v0, $v0, 0x6
D_80242C08:
/* 1714E8 80242C08 104300B1 */  beq       $v0, $v1, .L80242ED0
glabel func_80242C0C
/* 1714EC 80242C0C 3C030020 */   lui      $v1, (0x200000 >> 16)
/* 1714F0 80242C10 8E020000 */  lw        $v0, 0x0($s0)
glabel func_80242C14
/* 1714F4 80242C14 00431024 */  and       $v0, $v0, $v1
.L80242C18:
/* 1714F8 80242C18 144000AE */  bnez      $v0, .L80242ED4
glabel func_80242C1C
/* 1714FC 80242C1C 24040009 */   addiu    $a0, $zero, 0x9
glabel .L80242C20
/* 171500 80242C20 0C093903 */  jal       func_8024E40C
glabel func_80242C24
/* 171504 80242C24 24040002 */   addiu    $a0, $zero, 0x2
glabel .L80242C28
/* 171508 80242C28 0C093936 */  jal       D_8024E4D8_C0BD58
glabel .L80242C2C
/* 17150C 80242C2C 24040005 */   addiu    $a0, $zero, 0x5
D_80242C30:
/* 171510 80242C30 24020064 */  addiu     $v0, $zero, 0x64
.L80242C34:
/* 171514 80242C34 AE220000 */  sw        $v0, 0x0($s1)
D_80242C38:
/* 171518 80242C38 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80242C3C:
/* 17151C 80242C3C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
D_80242C40:
/* 171520 80242C40 24020064 */  addiu     $v0, $zero, 0x64
glabel func_80242C44
/* 171524 80242C44 14620048 */  bne       $v1, $v0, .L80242D68
D_80242C48:
/* 171528 80242C48 24020001 */   addiu    $v0, $zero, 0x1
.L80242C4C:
/* 17152C 80242C4C 0C093961 */  jal       func_8024E584
D_80242C50:
/* 171530 80242C50 00000000 */   nop
/* 171534 80242C54 10400041 */  beqz      $v0, .L80242D5C
D_80242C58:
/* 171538 80242C58 00000000 */   nop
glabel func_80242C5C
/* 17153C 80242C5C 3C13802A */  lui       $s3, %hi(D_8029F258)
D_80242C60:
/* 171540 80242C60 2673F258 */  addiu     $s3, $s3, %lo(D_8029F258)
D_80242C64:
/* 171544 80242C64 0C098F18 */  jal       reset_actor_turn_info
glabel func_80242C68
/* 171548 80242C68 AE600000 */   sw       $zero, 0x0($s3)
D_80242C6C:
/* 17154C 80242C6C 2402007F */  addiu     $v0, $zero, 0x7F
D_80242C70:
/* 171550 80242C70 3C05802A */  lui       $a1, %hi(D_8029F254)
.L80242C74:
/* 171554 80242C74 24A5F254 */  addiu     $a1, $a1, %lo(D_8029F254)
glabel func_80242C78
/* 171558 80242C78 8E5000DC */  lw        $s0, 0xDC($s2)
/* 17155C 80242C7C 3C11800E */  lui       $s1, %hi(gBattleStatus)
.L80242C80:
/* 171560 80242C80 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
glabel func_80242C84
/* 171564 80242C84 A2420086 */  sb        $v0, 0x86($s2)
.L80242C88:
/* 171568 80242C88 A2420087 */  sb        $v0, 0x87($s2)
.L80242C8C:
/* 17156C 80242C8C ACA00000 */  sw        $zero, 0x0($a1)
.L80242C90:
/* 171570 80242C90 8E220000 */  lw        $v0, 0x0($s1)
glabel func_80242C94
/* 171574 80242C94 3C030008 */  lui       $v1, (0x80000 >> 16)
.L80242C98:
/* 171578 80242C98 00431025 */  or        $v0, $v0, $v1
/* 17157C 80242C9C AE220000 */  sw        $v0, 0x0($s1)
glabel func_80242CA0
/* 171580 80242CA0 8E220004 */  lw        $v0, 0x4($s1)
/* 171584 80242CA4 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 171588 80242CA8 00431025 */  or        $v0, $v0, $v1
.L80242CAC:
/* 17158C 80242CAC 3C030800 */  lui       $v1, (0x8000000 >> 16)
.L80242CB0:
/* 171590 80242CB0 AE220004 */  sw        $v0, 0x4($s1)
.L80242CB4:
/* 171594 80242CB4 8E020000 */  lw        $v0, 0x0($s0)
.L80242CB8:
/* 171598 80242CB8 82040216 */  lb        $a0, 0x216($s0)
.L80242CBC:
/* 17159C 80242CBC 00431025 */  or        $v0, $v0, $v1
.L80242CC0:
/* 1715A0 80242CC0 10800017 */  beqz      $a0, func_80242D20
.L80242CC4:
/* 1715A4 80242CC4 AE020000 */   sw       $v0, 0x0($s0)
glabel func_80242CC8
/* 1715A8 80242CC8 92020217 */  lbu       $v0, 0x217($s0)
.L80242CCC:
/* 1715AC 80242CCC 2442FFFF */  addiu     $v0, $v0, -0x1
glabel func_80242CD0
/* 1715B0 80242CD0 A2020217 */  sb        $v0, 0x217($s0)
.L80242CD4:
/* 1715B4 80242CD4 24020001 */  addiu     $v0, $zero, 0x1
D_80242CD8:
/* 1715B8 80242CD8 ACA20000 */  sw        $v0, 0x0($a1)
.L80242CDC:
/* 1715BC 80242CDC 24020014 */  addiu     $v0, $zero, 0x14
D_80242CE0:
/* 1715C0 80242CE0 AE620000 */  sw        $v0, 0x0($s3)
glabel func_80242CE4
/* 1715C4 80242CE4 82030217 */  lb        $v1, 0x217($s0)
D_80242CE8:
/* 1715C8 80242CE8 18600005 */  blez      $v1, func_80242D00
glabel func_80242CEC
/* 1715CC 80242CEC 24040034 */   addiu    $a0, $zero, 0x34
glabel func_80242CF0
/* 1715D0 80242CF0 8E020440 */  lw        $v0, 0x440($s0)
D_80242CF4:
/* 1715D4 80242CF4 8C42000C */  lw        $v0, 0xC($v0)
glabel func_80242CF8
/* 1715D8 80242CF8 08090B48 */  j         func_80242D20
.L80242CFC:
/* 1715DC 80242CFC AC43003C */   sw       $v1, 0x3C($v0)
glabel func_80242D00
/* 1715E0 80242D00 0C09F7A0 */  jal       dispatch_event_partner
glabel func_80242D04
/* 1715E4 80242D04 A2000216 */   sb       $zero, 0x216($s0)
.L80242D08:
/* 1715E8 80242D08 8E020440 */  lw        $v0, 0x440($s0)
glabel func_80242D0C
/* 1715EC 80242D0C 8C42000C */  lw        $v0, 0xC($v0)
/* 1715F0 80242D10 AC40003C */  sw        $zero, 0x3C($v0)
glabel func_80242D14
/* 1715F4 80242D14 8E220004 */  lw        $v0, 0x4($s1)
.L80242D18:
/* 1715F8 80242D18 34420008 */  ori       $v0, $v0, 0x8
glabel func_80242D1C
/* 1715FC 80242D1C AE220004 */  sw        $v0, 0x4($s1)
glabel func_80242D20
/* 171600 80242D20 0000282D */  daddu     $a1, $zero, $zero
.L80242D24:
/* 171604 80242D24 3C060C00 */  lui       $a2, (0xC000000 >> 16)
glabel func_80242D28
/* 171608 80242D28 0240202D */  daddu     $a0, $s2, $zero
glabel func_80242D2C
/* 17160C 80242D2C 8C8300E0 */  lw        $v1, 0xE0($a0)
.L80242D30:
/* 171610 80242D30 10600004 */  beqz      $v1, .L80242D44
D_80242D34:
/* 171614 80242D34 24A50001 */   addiu    $a1, $a1, 0x1
glabel func_80242D38
/* 171618 80242D38 8C620000 */  lw        $v0, 0x0($v1)
glabel func_80242D3C
/* 17161C 80242D3C 00461025 */  or        $v0, $v0, $a2
D_80242D40:
/* 171620 80242D40 AC620000 */  sw        $v0, 0x0($v1)
.L80242D44:
/* 171624 80242D44 28A20018 */  slti      $v0, $a1, 0x18
glabel func_80242D48
/* 171628 80242D48 1440FFF8 */  bnez      $v0, func_80242D2C
glabel func_80242D4C
/* 17162C 80242D4C 24840004 */   addiu    $a0, $a0, 0x4
D_80242D50:
/* 171630 80242D50 24020001 */  addiu     $v0, $zero, 0x1
glabel .L80242D54
/* 171634 80242D54 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_80242D58
/* 171638 80242D58 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L80242D5C:
/* 17163C 80242D5C 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80242D60:
/* 171640 80242D60 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
glabel func_80242D64
/* 171644 80242D64 24020001 */  addiu     $v0, $zero, 0x1
.L80242D68:
/* 171648 80242D68 1462001B */  bne       $v1, $v0, func_80242DD8
.L80242D6C:
/* 17164C 80242D6C 00000000 */   nop
D_80242D70:
/* 171650 80242D70 1200000A */  beqz      $s0, .L80242D9C
.L80242D74:
/* 171654 80242D74 00000000 */   nop
.L80242D78:
/* 171658 80242D78 8E0201D8 */  lw        $v0, 0x1D8($s0)
.L80242D7C:
/* 17165C 80242D7C 50400007 */  beql      $v0, $zero, .L80242D9C
D_80242D80:
/* 171660 80242D80 AE0001D8 */   sw       $zero, 0x1D8($s0)
.L80242D84:
/* 171664 80242D84 8E0401E8 */  lw        $a0, 0x1E8($s0)
.L80242D88:
/* 171668 80242D88 0C0B1059 */  jal       does_script_exist
glabel func_80242D8C
/* 17166C 80242D8C 00000000 */   nop
glabel func_80242D90
/* 171670 80242D90 14400011 */  bnez      $v0, func_80242DD8
glabel func_80242D94
/* 171674 80242D94 00000000 */   nop
glabel func_80242D98
/* 171678 80242D98 AE0001D8 */  sw        $zero, 0x1D8($s0)
.L80242D9C:
/* 17167C 80242D9C 3C02800E */  lui       $v0, %hi(gBattleStatus)
.L80242DA0:
/* 171680 80242DA0 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
.L80242DA4:
/* 171684 80242DA4 8C430004 */  lw        $v1, 0x4($v0)
glabel dead_kzn_17_LetterDelivery_RestoreNpcAnim
/* 171688 80242DA8 2404FFF7 */  addiu     $a0, $zero, -0x9
D_80242DAC:
/* 17168C 80242DAC 00641824 */  and       $v1, $v1, $a0
glabel func_80242DB0
/* 171690 80242DB0 0C098D19 */  jal       btl_check_player_defeated
.L80242DB4:
/* 171694 80242DB4 AC430004 */   sw       $v1, 0x4($v0)
glabel func_80242DB8
/* 171698 80242DB8 14400048 */  bnez      $v0, .L80242EDC
glabel func_80242DBC
/* 17169C 80242DBC 00000000 */   nop
.L80242DC0:
/* 1716A0 80242DC0 0C098D0D */  jal       btl_check_enemies_defeated
D_80242DC4:
/* 1716A4 80242DC4 00000000 */   nop
D_80242DC8:
/* 1716A8 80242DC8 14400044 */  bnez      $v0, .L80242EDC
.L80242DCC:
/* 1716AC 80242DCC 24020008 */   addiu    $v0, $zero, 0x8
.L80242DD0:
/* 1716B0 80242DD0 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 1716B4 80242DD4 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_80242DD8
/* 1716B8 80242DD8 3C11800E */  lui       $s1, %hi(gBattleSubState)
.L80242DDC:
/* 1716BC 80242DDC 2631C4DC */  addiu     $s1, $s1, %lo(gBattleSubState)
glabel func_80242DE0
/* 1716C0 80242DE0 8E230000 */  lw        $v1, 0x0($s1)
glabel func_80242DE4
/* 1716C4 80242DE4 24020008 */  addiu     $v0, $zero, 0x8
glabel func_80242DE8
/* 1716C8 80242DE8 14620014 */  bne       $v1, $v0, .L80242E3C
glabel func_80242DEC
/* 1716CC 80242DEC 24020009 */   addiu    $v0, $zero, 0x9
glabel func_80242DF0
/* 1716D0 80242DF0 8E0201CC */  lw        $v0, 0x1CC($s0)
.L80242DF4:
/* 1716D4 80242DF4 1040000B */  beqz      $v0, .L80242E24
.L80242DF8:
/* 1716D8 80242DF8 2402000C */   addiu    $v0, $zero, 0xC
.L80242DFC:
/* 1716DC 80242DFC 2405000A */  addiu     $a1, $zero, 0xA
glabel dead_kzn_17_GetActingPartner
/* 1716E0 80242E00 A24201A7 */  sb        $v0, 0x1A7($s2)
.L80242E04:
/* 1716E4 80242E04 8E0401CC */  lw        $a0, 0x1CC($s0)
.L80242E08:
/* 1716E8 80242E08 0C0B0CF8 */  jal       start_script
glabel func_80242E0C
/* 1716EC 80242E0C 0000302D */   daddu    $a2, $zero, $zero
.L80242E10:
/* 1716F0 80242E10 AE0201DC */  sw        $v0, 0x1DC($s0)
glabel func_80242E14
/* 1716F4 80242E14 8C430144 */  lw        $v1, 0x144($v0)
.L80242E18:
/* 1716F8 80242E18 AE0301EC */  sw        $v1, 0x1EC($s0)
.L80242E1C:
/* 1716FC 80242E1C 24030100 */  addiu     $v1, $zero, 0x100
glabel func_80242E20
/* 171700 80242E20 AC430148 */  sw        $v1, 0x148($v0)
.L80242E24:
/* 171704 80242E24 24020009 */  addiu     $v0, $zero, 0x9
D_80242E28:
/* 171708 80242E28 AE220000 */  sw        $v0, 0x0($s1)
glabel dead_kzn_17_UnkFunc46
/* 17170C 80242E2C 3C11800E */  lui       $s1, %hi(gBattleSubState)
/* 171710 80242E30 2631C4DC */  addiu     $s1, $s1, %lo(gBattleSubState)
/* 171714 80242E34 8E230000 */  lw        $v1, 0x0($s1)
.L80242E38:
/* 171718 80242E38 24020009 */  addiu     $v0, $zero, 0x9
.L80242E3C:
/* 17171C 80242E3C 1462000A */  bne       $v1, $v0, .L80242E68
.L80242E40:
/* 171720 80242E40 00000000 */   nop
.L80242E44:
/* 171724 80242E44 8E0201CC */  lw        $v0, 0x1CC($s0)
.L80242E48:
/* 171728 80242E48 10400006 */  beqz      $v0, .L80242E64
.L80242E4C:
/* 17172C 80242E4C 2402000A */   addiu    $v0, $zero, 0xA
.L80242E50:
/* 171730 80242E50 8E0401EC */  lw        $a0, 0x1EC($s0)
glabel func_80242E54
/* 171734 80242E54 0C0B1059 */  jal       does_script_exist
.L80242E58:
/* 171738 80242E58 00000000 */   nop
.L80242E5C:
/* 17173C 80242E5C 14400002 */  bnez      $v0, .L80242E68
.L80242E60:
/* 171740 80242E60 2402000A */   addiu    $v0, $zero, 0xA
.L80242E64:
/* 171744 80242E64 AE220000 */  sw        $v0, 0x0($s1)
.L80242E68:
/* 171748 80242E68 3C03800E */  lui       $v1, %hi(gBattleSubState)
glabel func_80242E6C
/* 17174C 80242E6C 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
glabel func_80242E70
/* 171750 80242E70 2402000A */  addiu     $v0, $zero, 0xA
.L80242E74:
/* 171754 80242E74 14620019 */  bne       $v1, $v0, .L80242EDC
glabel func_80242E78
/* 171758 80242E78 00000000 */   nop
.L80242E7C:
/* 17175C 80242E7C 3C03802A */  lui       $v1, %hi(D_8029F258)
.L80242E80:
/* 171760 80242E80 2463F258 */  addiu     $v1, $v1, %lo(D_8029F258)
glabel func_80242E84
/* 171764 80242E84 8C620000 */  lw        $v0, 0x0($v1)
D_80242E88:
/* 171768 80242E88 10400003 */  beqz      $v0, jtbl_80242E98
glabel func_80242E8C
/* 17176C 80242E8C 2442FFFF */   addiu    $v0, $v0, -0x1
D_80242E90:
/* 171770 80242E90 08090BB7 */  j         .L80242EDC
glabel .L80242E94
/* 171774 80242E94 AC620000 */   sw       $v0, 0x0($v1)
jtbl_80242E98:
/* 171778 80242E98 3C02FFEF */  lui       $v0, (0xFFEFFFFF >> 16)
.L80242E9C:
/* 17177C 80242E9C 3442FFFF */  ori       $v0, $v0, (0xFFEFFFFF & 0xFFFF)
D_80242EA0:
/* 171780 80242EA0 3C05800E */  lui       $a1, %hi(gBattleStatus)
.L80242EA4:
/* 171784 80242EA4 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
flo_08_pad_2EA8:
/* 171788 80242EA8 8CA30004 */  lw        $v1, 0x4($a1)
D_80242EAC:
/* 17178C 80242EAC 3C04802A */  lui       $a0, %hi(D_8029F254)
D_80242EB0:
/* 171790 80242EB0 8C84F254 */  lw        $a0, %lo(D_8029F254)($a0)
glabel func_80242EB4
/* 171794 80242EB4 00621024 */  and       $v0, $v1, $v0
glabel func_80242EB8
/* 171798 80242EB8 14800003 */  bnez      $a0, .L80242EC8
glabel func_80242EBC
/* 17179C 80242EBC ACA20004 */   sw       $v0, 0x4($a1)
.L80242EC0:
/* 1717A0 80242EC0 08090BB5 */  j         .L80242ED4
glabel func_80242EC4_EA37C4
/* 1717A4 80242EC4 2404000B */   addiu    $a0, $zero, 0xB
.L80242EC8:
/* 1717A8 80242EC8 34420004 */  ori       $v0, $v0, 0x4
D_80242ECC:
/* 1717AC 80242ECC ACA20004 */  sw        $v0, 0x4($a1)
.L80242ED0:
/* 1717B0 80242ED0 24040009 */  addiu     $a0, $zero, 0x9
.L80242ED4:
/* 1717B4 80242ED4 0C090464 */  jal       func_80241190
.L80242ED8:
/* 1717B8 80242ED8 00000000 */   nop
.L80242EDC:
/* 1717BC 80242EDC 8FBF0020 */  lw        $ra, 0x20($sp)
D_80242EE0:
/* 1717C0 80242EE0 8FB3001C */  lw        $s3, 0x1C($sp)
.L80242EE4:
/* 1717C4 80242EE4 8FB20018 */  lw        $s2, 0x18($sp)
D_80242EE8:
/* 1717C8 80242EE8 8FB10014 */  lw        $s1, 0x14($sp)
.L80242EEC:
/* 1717CC 80242EEC 8FB00010 */  lw        $s0, 0x10($sp)
D_80242EF0:
/* 1717D0 80242EF0 03E00008 */  jr        $ra
.L80242EF4:
/* 1717D4 80242EF4 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_begin_partner_turn(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* partner = battleStatus->partnerActor;
    Actor* enemy;
    Evt* script;
    s32 i;

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_INIT) {
        if (partner == NULL) {
            D_8029F254 = 1;
            gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_END_DELAY;
        } else if ((battleStatus->flags2 & (BS_FLAGS2_4 | BS_FLAGS2_2)) != (BS_FLAGS2_4 | BS_FLAGS2_2)) {
            if (!(partner->flags & ACTOR_FLAG_NO_ATTACK)) {
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                btl_cam_move(5);
                gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_RESET_STATE;
            } else {
                btl_set_state(BATTLE_STATE_9);
                return;
            }
        } else {
            btl_set_state(BATTLE_STATE_9);
            return;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_RESET_STATE) {
        if (btl_cam_is_moving_done()) {
            D_8029F258 = 0;
            reset_actor_turn_info();
            partner = battleStatus->partnerActor;
            battleStatus->unk_86 = 127;
            battleStatus->blockResult = 127;
            D_8029F254 = 0;
            gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING;
            gBattleStatus.flags2 |= BS_FLAGS1_PLAYER_IN_BACK;
            partner->flags |= ACTOR_FLAG_8000000;

            if (partner->koStatus != 0) {
                partner->koDuration--;
                D_8029F254 = 1;
                D_8029F258 = 20;
                if (partner->koDuration > 0) {
                    partner->disableEffect->data.disableX->koDuration = partner->koDuration;
                } else {
                    partner->koStatus = 0;
                    dispatch_event_partner(EVENT_RECOVER_FROM_KO);
                    partner->disableEffect->data.disableX->koDuration = 0;
                    gBattleStatus.flags2 |= BS_FLAGS2_8;
                }
            }

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemy = battleStatus->enemyActors[i];
                if (enemy != NULL) {
                    enemy->flags |= ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000;
                }
            }
            gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_AWAIT_RECOVER_DONE;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_AWAIT_RECOVER_DONE) {
        if (partner != NULL) {
            if (partner->handleEventScript == NULL || !does_script_exist(partner->handleEventScriptID)) {
                partner->handleEventScript = NULL;
            } else {
                goto block_27; // TODO find a way to remove
            }
        }

        gBattleStatus.flags2 &= ~BS_FLAGS2_8;
        if (btl_check_player_defeated() || btl_check_enemies_defeated()) {
            return;
        }
        gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_EXEC_TURN_SCRIPT;
    }

block_27:
    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_EXEC_TURN_SCRIPT) {
        if (partner->handlePhaseSource != NULL) {
            battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
            script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0);
            partner->handlePhaseScript = script;
            partner->handleBatttlePhaseScriptID = script->id;
            script->owner1.actorID = ACTOR_PARTNER;
        }
        gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_AWAIT_TURN_SCRIPT;
    }

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_AWAIT_TURN_SCRIPT) {
        if (partner->handlePhaseSource == NULL || !does_script_exist(partner->handleBatttlePhaseScriptID)) {
            gBattleSubState = BTL_SUBSTATE_BEGIN_PARTNER_TURN_END_DELAY;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_BEGIN_PARTNER_TURN_END_DELAY) {
        if (D_8029F258 != 0) {
            D_8029F258--;
            return;
        }
        gBattleStatus.flags2 &= ~BS_FLAGS2_100000;
        if (D_8029F254 == 0) {
            btl_set_state(BATTLE_STATE_SWITCH_TO_PARTNER);
        } else {
            gBattleStatus.flags2 |= BS_FLAGS2_4;
            btl_set_state(BATTLE_STATE_9);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel stars_shimmer_appendGfx
/* 35587C E004491C 27BDFEE8 */  addiu     $sp, $sp, -0x118
/* 355880 E0044920 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 355884 E0044924 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 355888 E0044928 AFA40118 */  sw        $a0, 0x118($sp)
/* 35588C E004492C 27A40018 */  addiu     $a0, $sp, 0x18
/* 355890 E0044930 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 355894 E0044934 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 355898 E0044938 AFBF00FC */  sw        $ra, 0xFC($sp)
/* 35589C E004493C AFBE00F8 */  sw        $fp, 0xF8($sp)
/* 3558A0 E0044940 AFB700F4 */  sw        $s7, 0xF4($sp)
/* 3558A4 E0044944 AFB600F0 */  sw        $s6, 0xF0($sp)
/* 3558A8 E0044948 AFB500EC */  sw        $s5, 0xEC($sp)
/* 3558AC E004494C AFB400E8 */  sw        $s4, 0xE8($sp)
/* 3558B0 E0044950 AFB300E4 */  sw        $s3, 0xE4($sp)
/* 3558B4 E0044954 AFB200E0 */  sw        $s2, 0xE0($sp)
/* 3558B8 E0044958 AFB100DC */  sw        $s1, 0xDC($sp)
/* 3558BC E004495C AFB000D8 */  sw        $s0, 0xD8($sp)
/* 3558C0 E0044960 F7B80110 */  sdc1      $f24, 0x110($sp)
/* 3558C4 E0044964 F7B60108 */  sdc1      $f22, 0x108($sp)
/* 3558C8 E0044968 F7B40100 */  sdc1      $f20, 0x100($sp)
/* 3558CC E004496C 8CA30000 */  lw        $v1, 0x0($a1)
/* 3558D0 E0044970 8FA90118 */  lw        $t1, 0x118($sp)
/* 3558D4 E0044974 0060302D */  daddu     $a2, $v1, $zero
/* 3558D8 E0044978 8D31000C */  lw        $s1, 0xC($t1)
/* 3558DC E004497C 24630008 */  addiu     $v1, $v1, 0x8
/* 3558E0 E0044980 ACA30000 */  sw        $v1, 0x0($a1)
/* 3558E4 E0044984 86320002 */  lh        $s2, 0x2($s1)
/* 3558E8 E0044988 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3558EC E004498C ACC20000 */  sw        $v0, 0x0($a2)
/* 3558F0 E0044990 24620008 */  addiu     $v0, $v1, 0x8
/* 3558F4 E0044994 ACC00004 */  sw        $zero, 0x4($a2)
/* 3558F8 E0044998 ACA20000 */  sw        $v0, 0x0($a1)
/* 3558FC E004499C AC670000 */  sw        $a3, 0x0($v1)
/* 355900 E00449A0 8D260010 */  lw        $a2, 0x10($t1)
/* 355904 E00449A4 24620010 */  addiu     $v0, $v1, 0x10
/* 355908 E00449A8 ACA20000 */  sw        $v0, 0x0($a1)
/* 35590C E00449AC 8CC5001C */  lw        $a1, 0x1C($a2)
/* 355910 E00449B0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 355914 E00449B4 AC620008 */  sw        $v0, 0x8($v1)
/* 355918 E00449B8 3C020900 */  lui       $v0, %hi(D_09000F20_327330)
/* 35591C E00449BC 24420F20 */  addiu     $v0, $v0, %lo(D_09000F20_327330)
/* 355920 E00449C0 AC62000C */  sw        $v0, 0xC($v1)
/* 355924 E00449C4 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 355928 E00449C8 00A22821 */  addu      $a1, $a1, $v0
/* 35592C E00449CC AC650004 */  sw        $a1, 0x4($v1)
/* 355930 E00449D0 8E250004 */  lw        $a1, 0x4($s1)
/* 355934 E00449D4 8E260008 */  lw        $a2, 0x8($s1)
/* 355938 E00449D8 8E220020 */  lw        $v0, 0x20($s1)
/* 35593C E00449DC 8E27000C */  lw        $a3, 0xC($s1)
/* 355940 E00449E0 2442FFFF */  addiu     $v0, $v0, -0x1
/* 355944 E00449E4 00021840 */  sll       $v1, $v0, 1
/* 355948 E00449E8 0C080108 */  jal       shim_guTranslateF
/* 35594C E00449EC 0062A021 */   addu     $s4, $v1, $v0
/* 355950 E00449F0 27B00058 */  addiu     $s0, $sp, 0x58
/* 355954 E00449F4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 355958 E00449F8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 35595C E00449FC 44800000 */  mtc1      $zero, $f0
/* 355960 E0044A00 00031080 */  sll       $v0, $v1, 2
/* 355964 E0044A04 00431021 */  addu      $v0, $v0, $v1
/* 355968 E0044A08 00021080 */  sll       $v0, $v0, 2
/* 35596C E0044A0C 00431023 */  subu      $v0, $v0, $v1
/* 355970 E0044A10 000218C0 */  sll       $v1, $v0, 3
/* 355974 E0044A14 00431021 */  addu      $v0, $v0, $v1
/* 355978 E0044A18 000210C0 */  sll       $v0, $v0, 3
/* 35597C E0044A1C 44060000 */  mfc1      $a2, $f0
/* 355980 E0044A20 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 355984 E0044A24 00220821 */  addu      $at, $at, $v0
/* 355988 E0044A28 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 35598C E0044A2C 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 355990 E0044A30 46000007 */  neg.s     $f0, $f0
/* 355994 E0044A34 44050000 */  mfc1      $a1, $f0
/* 355998 E0044A38 0200202D */  daddu     $a0, $s0, $zero
/* 35599C E0044A3C 0C080104 */  jal       shim_guRotateF
/* 3559A0 E0044A40 AFA60010 */   sw       $a2, 0x10($sp)
/* 3559A4 E0044A44 0200202D */  daddu     $a0, $s0, $zero
/* 3559A8 E0044A48 27A50018 */  addiu     $a1, $sp, 0x18
/* 3559AC E0044A4C 0C080114 */  jal       shim_guMtxCatF
/* 3559B0 E0044A50 27A60098 */   addiu    $a2, $sp, 0x98
/* 3559B4 E0044A54 2E42001F */  sltiu     $v0, $s2, 0x1F
/* 3559B8 E0044A58 1040002E */  beqz      $v0, .LE0044B14
/* 3559BC E0044A5C 00121080 */   sll      $v0, $s2, 2
/* 3559C0 E0044A60 3C01E004 */  lui       $at, (0xE0044F00 >> 16)
/* 3559C4 E0044A64 00220821 */  addu      $at, $at, $v0
/* 3559C8 E0044A68 8C224F00 */  lw        $v0, (0xE0044F00 & 0xFFFF)($at)
/* 3559CC E0044A6C 00400008 */  jr        $v0
/* 3559D0 E0044A70 00000000 */   nop
/* 3559D4 E0044A74 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3559D8 E0044A78 4481C000 */  mtc1      $at, $f24
/* 3559DC E0044A7C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 3559E0 E0044A80 4481B000 */  mtc1      $at, $f22
/* 3559E4 E0044A84 3C013DCC */  lui       $at, (0x3DCCCCCD >> 16)
/* 3559E8 E0044A88 3421CCCD */  ori       $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 3559EC E0044A8C 4481A000 */  mtc1      $at, $f20
/* 3559F0 E0044A90 080112CC */  j         .LE0044B30
/* 3559F4 E0044A94 00000000 */   nop
/* 3559F8 E0044A98 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3559FC E0044A9C 4481C000 */  mtc1      $at, $f24
/* 355A00 E0044AA0 3C013F4C */  lui       $at, (0x3F4CCCCD >> 16)
/* 355A04 E0044AA4 3421CCCD */  ori       $at, $at, (0x3F4CCCCD & 0xFFFF)
/* 355A08 E0044AA8 4481B000 */  mtc1      $at, $f22
/* 355A0C E0044AAC 86220000 */  lh        $v0, 0x0($s1)
/* 355A10 E0044AB0 3C013F33 */  lui       $at, (0x3F333333 >> 16)
/* 355A14 E0044AB4 34213333 */  ori       $at, $at, (0x3F333333 & 0xFFFF)
/* 355A18 E0044AB8 4481A000 */  mtc1      $at, $f20
/* 355A1C E0044ABC 1040001C */  beqz      $v0, .LE0044B30
/* 355A20 E0044AC0 3C06E200 */   lui      $a2, (0xE200001C >> 16)
/* 355A24 E0044AC4 34C6001C */  ori       $a2, $a2, (0xE200001C & 0xFFFF)
/* 355A28 E0044AC8 3C050050 */  lui       $a1, (0x504B50 >> 16)
/* 355A2C E0044ACC 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 355A30 E0044AD0 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 355A34 E0044AD4 8C820000 */  lw        $v0, 0x0($a0)
/* 355A38 E0044AD8 34A54B50 */  ori       $a1, $a1, (0x504B50 & 0xFFFF)
/* 355A3C E0044ADC 0040182D */  daddu     $v1, $v0, $zero
/* 355A40 E0044AE0 24420008 */  addiu     $v0, $v0, 0x8
/* 355A44 E0044AE4 AC820000 */  sw        $v0, 0x0($a0)
/* 355A48 E0044AE8 AC660000 */  sw        $a2, 0x0($v1)
/* 355A4C E0044AEC 080112CC */  j         .LE0044B30
/* 355A50 E0044AF0 AC650004 */   sw       $a1, 0x4($v1)
/* 355A54 E0044AF4 3C013FB3 */  lui       $at, (0x3FB33333 >> 16)
/* 355A58 E0044AF8 34213333 */  ori       $at, $at, (0x3FB33333 & 0xFFFF)
/* 355A5C E0044AFC 4481B000 */  mtc1      $at, $f22
/* 355A60 E0044B00 3C013F33 */  lui       $at, (0x3F333333 >> 16)
/* 355A64 E0044B04 34213333 */  ori       $at, $at, (0x3F333333 & 0xFFFF)
/* 355A68 E0044B08 4481A000 */  mtc1      $at, $f20
/* 355A6C E0044B0C 080112CC */  j         .LE0044B30
/* 355A70 E0044B10 4600B606 */   mov.s    $f24, $f22
.LE0044B14:
/* 355A74 E0044B14 3C013F33 */  lui       $at, (0x3F333333 >> 16)
/* 355A78 E0044B18 34213333 */  ori       $at, $at, (0x3F333333 & 0xFFFF)
/* 355A7C E0044B1C 4481A000 */  mtc1      $at, $f20
/* 355A80 E0044B20 3C013FB3 */  lui       $at, (0x3FB33333 >> 16)
/* 355A84 E0044B24 34213333 */  ori       $at, $at, (0x3FB33333 & 0xFFFF)
/* 355A88 E0044B28 4481C000 */  mtc1      $at, $f24
/* 355A8C E0044B2C 4600A586 */  mov.s     $f22, $f20
.LE0044B30:
/* 355A90 E0044B30 8FA90118 */  lw        $t1, 0x118($sp)
/* 355A94 E0044B34 2631002C */  addiu     $s1, $s1, 0x2C
/* 355A98 E0044B38 8D220008 */  lw        $v0, 0x8($t1)
/* 355A9C E0044B3C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 355AA0 E0044B40 18400083 */  blez      $v0, .LE0044D50
/* 355AA4 E0044B44 0000902D */   daddu    $s2, $zero, $zero
/* 355AA8 E0044B48 27B60058 */  addiu     $s6, $sp, 0x58
/* 355AAC E0044B4C 3C178007 */  lui       $s7, %hi(gMatrixListPos)
/* 355AB0 E0044B50 26F741F0 */  addiu     $s7, $s7, %lo(gMatrixListPos)
/* 355AB4 E0044B54 3C150001 */  lui       $s5, (0x11630 >> 16)
/* 355AB8 E0044B58 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* 355ABC E0044B5C 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 355AC0 E0044B60 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 355AC4 E0044B64 2631001C */  addiu     $s1, $s1, 0x1C
/* 355AC8 E0044B68 3C1EE004 */  lui       $fp, %hi(D_E0044DD0)
/* 355ACC E0044B6C 27DE4DD0 */  addiu     $fp, $fp, %lo(D_E0044DD0)
/* 355AD0 E0044B70 029E8021 */  addu      $s0, $s4, $fp
.LE0044B74:
/* 355AD4 E0044B74 8E34000C */  lw        $s4, 0xC($s1)
/* 355AD8 E0044B78 0680006E */  bltz      $s4, .LE0044D34
/* 355ADC E0044B7C 00000000 */   nop
/* 355AE0 E0044B80 8E25FFE8 */  lw        $a1, -0x18($s1)
/* 355AE4 E0044B84 8E26FFEC */  lw        $a2, -0x14($s1)
/* 355AE8 E0044B88 8E27FFF0 */  lw        $a3, -0x10($s1)
/* 355AEC E0044B8C 0C080108 */  jal       shim_guTranslateF
/* 355AF0 E0044B90 02C0202D */   daddu    $a0, $s6, $zero
/* 355AF4 E0044B94 02C0202D */  daddu     $a0, $s6, $zero
/* 355AF8 E0044B98 27A50098 */  addiu     $a1, $sp, 0x98
/* 355AFC E0044B9C C6200000 */  lwc1      $f0, 0x0($s1)
/* 355B00 E0044BA0 27A60018 */  addiu     $a2, $sp, 0x18
/* 355B04 E0044BA4 E7A00080 */  swc1      $f0, 0x80($sp)
/* 355B08 E0044BA8 E7A0006C */  swc1      $f0, 0x6C($sp)
/* 355B0C E0044BAC 0C080114 */  jal       shim_guMtxCatF
/* 355B10 E0044BB0 E7A00058 */   swc1     $f0, 0x58($sp)
/* 355B14 E0044BB4 27A40018 */  addiu     $a0, $sp, 0x18
/* 355B18 E0044BB8 96E50000 */  lhu       $a1, 0x0($s7)
/* 355B1C E0044BBC 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 355B20 E0044BC0 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 355B24 E0044BC4 00052980 */  sll       $a1, $a1, 6
/* 355B28 E0044BC8 00B52821 */  addu      $a1, $a1, $s5
/* 355B2C E0044BCC 0C080118 */  jal       shim_guMtxF2L
/* 355B30 E0044BD0 00452821 */   addu     $a1, $v0, $a1
/* 355B34 E0044BD4 27C20024 */  addiu     $v0, $fp, 0x24
/* 355B38 E0044BD8 0202102A */  slt       $v0, $s0, $v0
/* 355B3C E0044BDC 50400001 */  beql      $v0, $zero, .LE0044BE4
/* 355B40 E0044BE0 03C0802D */   daddu    $s0, $fp, $zero
.LE0044BE4:
/* 355B44 E0044BE4 92020000 */  lbu       $v0, 0x0($s0)
/* 355B48 E0044BE8 44822000 */  mtc1      $v0, $f4
/* 355B4C E0044BEC 00000000 */  nop
/* 355B50 E0044BF0 46802120 */  cvt.s.w   $f4, $f4
/* 355B54 E0044BF4 46182102 */  mul.s     $f4, $f4, $f24
/* 355B58 E0044BF8 00000000 */  nop
/* 355B5C E0044BFC 26100001 */  addiu     $s0, $s0, 0x1
/* 355B60 E0044C00 92020000 */  lbu       $v0, 0x0($s0)
/* 355B64 E0044C04 44821000 */  mtc1      $v0, $f2
/* 355B68 E0044C08 00000000 */  nop
/* 355B6C E0044C0C 468010A0 */  cvt.s.w   $f2, $f2
/* 355B70 E0044C10 46161082 */  mul.s     $f2, $f2, $f22
/* 355B74 E0044C14 00000000 */  nop
/* 355B78 E0044C18 26100001 */  addiu     $s0, $s0, 0x1
/* 355B7C E0044C1C 92020000 */  lbu       $v0, 0x0($s0)
/* 355B80 E0044C20 44820000 */  mtc1      $v0, $f0
/* 355B84 E0044C24 00000000 */  nop
/* 355B88 E0044C28 46800020 */  cvt.s.w   $f0, $f0
/* 355B8C E0044C2C 46140002 */  mul.s     $f0, $f0, $f20
/* 355B90 E0044C30 00000000 */  nop
/* 355B94 E0044C34 4600218D */  trunc.w.s $f6, $f4
/* 355B98 E0044C38 44033000 */  mfc1      $v1, $f6
/* 355B9C E0044C3C 00000000 */  nop
/* 355BA0 E0044C40 28620100 */  slti      $v0, $v1, 0x100
/* 355BA4 E0044C44 4600118D */  trunc.w.s $f6, $f2
/* 355BA8 E0044C48 44073000 */  mfc1      $a3, $f6
/* 355BAC E0044C4C 4600018D */  trunc.w.s $f6, $f0
/* 355BB0 E0044C50 44083000 */  mfc1      $t0, $f6
/* 355BB4 E0044C54 14400002 */  bnez      $v0, .LE0044C60
/* 355BB8 E0044C58 26100001 */   addiu    $s0, $s0, 0x1
/* 355BBC E0044C5C 240300FF */  addiu     $v1, $zero, 0xFF
.LE0044C60:
/* 355BC0 E0044C60 28E20100 */  slti      $v0, $a3, 0x100
/* 355BC4 E0044C64 50400001 */  beql      $v0, $zero, .LE0044C6C
/* 355BC8 E0044C68 240700FF */   addiu    $a3, $zero, 0xFF
.LE0044C6C:
/* 355BCC E0044C6C 29020100 */  slti      $v0, $t0, 0x100
/* 355BD0 E0044C70 50400001 */  beql      $v0, $zero, .LE0044C78
/* 355BD4 E0044C74 240800FF */   addiu    $t0, $zero, 0xFF
.LE0044C78:
/* 355BD8 E0044C78 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 355BDC E0044C7C 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 355BE0 E0044C80 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 355BE4 E0044C84 00031E00 */  sll       $v1, $v1, 24
/* 355BE8 E0044C88 8E640000 */  lw        $a0, 0x0($s3)
/* 355BEC E0044C8C 3C09E004 */  lui       $t1, %hi(D_E0044DB0)
/* 355BF0 E0044C90 25294DB0 */  addiu     $t1, $t1, %lo(D_E0044DB0)
/* 355BF4 E0044C94 0080282D */  daddu     $a1, $a0, $zero
/* 355BF8 E0044C98 24840008 */  addiu     $a0, $a0, 0x8
/* 355BFC E0044C9C AE640000 */  sw        $a0, 0x0($s3)
/* 355C00 E0044CA0 ACA20000 */  sw        $v0, 0x0($a1)
/* 355C04 E0044CA4 30E200FF */  andi      $v0, $a3, 0xFF
/* 355C08 E0044CA8 00021400 */  sll       $v0, $v0, 16
/* 355C0C E0044CAC 00621825 */  or        $v1, $v1, $v0
/* 355C10 E0044CB0 310200FF */  andi      $v0, $t0, 0xFF
/* 355C14 E0044CB4 00021200 */  sll       $v0, $v0, 8
/* 355C18 E0044CB8 00621825 */  or        $v1, $v1, $v0
/* 355C1C E0044CBC 346300FF */  ori       $v1, $v1, 0xFF
/* 355C20 E0044CC0 24820008 */  addiu     $v0, $a0, 0x8
/* 355C24 E0044CC4 ACA30004 */  sw        $v1, 0x4($a1)
/* 355C28 E0044CC8 AE620000 */  sw        $v0, 0x0($s3)
/* 355C2C E0044CCC 96E20000 */  lhu       $v0, 0x0($s7)
/* 355C30 E0044CD0 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 355C34 E0044CD4 AC830000 */  sw        $v1, 0x0($a0)
/* 355C38 E0044CD8 24430001 */  addiu     $v1, $v0, 0x1
/* 355C3C E0044CDC 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 355C40 E0044CE0 00021180 */  sll       $v0, $v0, 6
/* 355C44 E0044CE4 A6E30000 */  sh        $v1, 0x0($s7)
/* 355C48 E0044CE8 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 355C4C E0044CEC 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 355C50 E0044CF0 00551021 */  addu      $v0, $v0, $s5
/* 355C54 E0044CF4 00621821 */  addu      $v1, $v1, $v0
/* 355C58 E0044CF8 24820010 */  addiu     $v0, $a0, 0x10
/* 355C5C E0044CFC AC830004 */  sw        $v1, 0x4($a0)
/* 355C60 E0044D00 AE620000 */  sw        $v0, 0x0($s3)
/* 355C64 E0044D04 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 355C68 E0044D08 AC820008 */  sw        $v0, 0x8($a0)
/* 355C6C E0044D0C 32820007 */  andi      $v0, $s4, 0x7
/* 355C70 E0044D10 00021080 */  sll       $v0, $v0, 2
/* 355C74 E0044D14 00491021 */  addu      $v0, $v0, $t1
/* 355C78 E0044D18 8C430000 */  lw        $v1, 0x0($v0)
/* 355C7C E0044D1C 24820018 */  addiu     $v0, $a0, 0x18
/* 355C80 E0044D20 AE620000 */  sw        $v0, 0x0($s3)
/* 355C84 E0044D24 24020040 */  addiu     $v0, $zero, 0x40
/* 355C88 E0044D28 AC860010 */  sw        $a2, 0x10($a0)
/* 355C8C E0044D2C AC820014 */  sw        $v0, 0x14($a0)
/* 355C90 E0044D30 AC83000C */  sw        $v1, 0xC($a0)
.LE0044D34:
/* 355C94 E0044D34 8FA90118 */  lw        $t1, 0x118($sp)
/* 355C98 E0044D38 26520001 */  addiu     $s2, $s2, 0x1
/* 355C9C E0044D3C 8D220008 */  lw        $v0, 0x8($t1)
/* 355CA0 E0044D40 2442FFFF */  addiu     $v0, $v0, -0x1
/* 355CA4 E0044D44 0242102A */  slt       $v0, $s2, $v0
/* 355CA8 E0044D48 1440FF8A */  bnez      $v0, .LE0044B74
/* 355CAC E0044D4C 2631002C */   addiu    $s1, $s1, 0x2C
.LE0044D50:
/* 355CB0 E0044D50 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 355CB4 E0044D54 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 355CB8 E0044D58 8C620000 */  lw        $v0, 0x0($v1)
/* 355CBC E0044D5C 0040202D */  daddu     $a0, $v0, $zero
/* 355CC0 E0044D60 24420008 */  addiu     $v0, $v0, 0x8
/* 355CC4 E0044D64 AC620000 */  sw        $v0, 0x0($v1)
/* 355CC8 E0044D68 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 355CCC E0044D6C AC820000 */  sw        $v0, 0x0($a0)
/* 355CD0 E0044D70 AC800004 */  sw        $zero, 0x4($a0)
/* 355CD4 E0044D74 8FBF00FC */  lw        $ra, 0xFC($sp)
/* 355CD8 E0044D78 8FBE00F8 */  lw        $fp, 0xF8($sp)
/* 355CDC E0044D7C 8FB700F4 */  lw        $s7, 0xF4($sp)
/* 355CE0 E0044D80 8FB600F0 */  lw        $s6, 0xF0($sp)
/* 355CE4 E0044D84 8FB500EC */  lw        $s5, 0xEC($sp)
/* 355CE8 E0044D88 8FB400E8 */  lw        $s4, 0xE8($sp)
/* 355CEC E0044D8C 8FB300E4 */  lw        $s3, 0xE4($sp)
/* 355CF0 E0044D90 8FB200E0 */  lw        $s2, 0xE0($sp)
/* 355CF4 E0044D94 8FB100DC */  lw        $s1, 0xDC($sp)
/* 355CF8 E0044D98 8FB000D8 */  lw        $s0, 0xD8($sp)
/* 355CFC E0044D9C D7B80110 */  ldc1      $f24, 0x110($sp)
/* 355D00 E0044DA0 D7B60108 */  ldc1      $f22, 0x108($sp)
/* 355D04 E0044DA4 D7B40100 */  ldc1      $f20, 0x100($sp)
/* 355D08 E0044DA8 03E00008 */  jr        $ra
/* 355D0C E0044DAC 27BD0118 */   addiu    $sp, $sp, 0x118

### DECOMPILED C INSTRUCTIONS:

void stars_shimmer_appendGfx(void* effect) {
    Matrix4f sp18, sp58, sp98;
    StarsShimmerFXData* data = ((EffectInstance*)effect)->data.starsShimmer;
    s32 type;
    s32 temp_s4;
    s32 unk_28;
    f32 rf, gf, bf;
    s32 r, g, b;
    s32 i;

    type = data->state;

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

    temp_s4 = (data->lifeTime - 1) * 3;
    shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp58, sp18, sp98);

    switch (type) {
        case 0:
        case 1:
        case 2:
        case 10:
            rf = 1.0f;
            gf = 0.5f;
            bf = 0.1f;
            break;
        case 3:
        case 30:
            rf = 1.0f;
            gf = 0.8f;
            bf = 0.7f;
            if (data->unk_00 != 0) {
                gDPSetRenderMode(gMainGfxPos++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
            }
            break;
        case 5:
            rf = 1.4f;
            gf = 1.4f;
            bf = 0.7f;
            break;
        default:
            rf = 1.4f;
            gf = 0.7f;
            bf = 0.7f;
            break;
    }

    data++;
    for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, data++) {
        unk_28 = data->unk_28;
        if (unk_28 >= 0) {
            shim_guTranslateF(sp58, data->pos.x, data->pos.y, data->pos.z);
            sp58[0][0] = sp58[1][1] = sp58[2][2] = data->unk_1C;
            shim_guMtxCatF(sp58, sp98, sp18);
            shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
            if (temp_s4 >= 36) {
                temp_s4 = 0;
            }
            r = D_E0044DD0[temp_s4++] * rf;
            g = D_E0044DD0[temp_s4++] * gf;
            b = D_E0044DD0[temp_s4++] * bf;
            if (r > 255) {
                r = 255;
            }
            if (g > 255) {
                g = 255;
            }
            if (b > 255) {
                b = 255;
            }
            gDPSetPrimColor(gMainGfxPos++, 0, 0, r, g, b, 255);
            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
                      G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gSPDisplayList(gMainGfxPos++, D_E0044DB0[unk_28 & 7]);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802A5290_7ACC30
/* 41A020 802A5290 3C02802B */  lui       $v0, %hi(BattleSubmenuStratsState)
/* 41A024 802A5294 9042D604 */  lbu       $v0, %lo(BattleSubmenuStratsState)($v0)
/* 41A028 802A5298 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 41A02C 802A529C AFB70034 */  sw        $s7, 0x34($sp)
/* 41A030 802A52A0 00A0B82D */  daddu     $s7, $a1, $zero
/* 41A034 802A52A4 AFBF003C */  sw        $ra, 0x3C($sp)
/* 41A038 802A52A8 AFBE0038 */  sw        $fp, 0x38($sp)
/* 41A03C 802A52AC AFB60030 */  sw        $s6, 0x30($sp)
/* 41A040 802A52B0 AFB5002C */  sw        $s5, 0x2C($sp)
/* 41A044 802A52B4 AFB40028 */  sw        $s4, 0x28($sp)
/* 41A048 802A52B8 AFB30024 */  sw        $s3, 0x24($sp)
/* 41A04C 802A52BC AFB20020 */  sw        $s2, 0x20($sp)
/* 41A050 802A52C0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 41A054 802A52C4 AFB00018 */  sw        $s0, 0x18($sp)
/* 41A058 802A52C8 24420001 */  addiu     $v0, $v0, 0x1
/* 41A05C 802A52CC 00021600 */  sll       $v0, $v0, 24
/* 41A060 802A52D0 00021E03 */  sra       $v1, $v0, 24
/* 41A064 802A52D4 2C62002B */  sltiu     $v0, $v1, 0x2B
/* 41A068 802A52D8 104000FB */  beqz      $v0, .L802A56C8_7AD068
/* 41A06C 802A52DC AFA60048 */   sw       $a2, 0x48($sp)
/* 41A070 802A52E0 00031080 */  sll       $v0, $v1, 2
/* 41A074 802A52E4 3C01802B */  lui       $at, %hi(jtbl_802ABAA8_7B3448)
/* 41A078 802A52E8 00220821 */  addu      $at, $at, $v0
/* 41A07C 802A52EC 8C22BAA8 */  lw        $v0, %lo(jtbl_802ABAA8_7B3448)($at)
/* 41A080 802A52F0 00400008 */  jr        $v0
/* 41A084 802A52F4 00000000 */   nop
glabel .L802A52F8_7ACC98
/* 41A088 802A52F8 3C03802B */  lui       $v1, %hi(D_802AD608)
/* 41A08C 802A52FC 8063D608 */  lb        $v1, %lo(D_802AD608)($v1)
/* 41A090 802A5300 3C08802B */  lui       $t0, %hi(D_802AD60C)
/* 41A094 802A5304 8508D60C */  lh        $t0, %lo(D_802AD60C)($t0)
/* 41A098 802A5308 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 41A09C 802A530C 44811800 */  mtc1      $at, $f3
/* 41A0A0 802A5310 44801000 */  mtc1      $zero, $f2
/* 41A0A4 802A5314 00031823 */  negu      $v1, $v1
/* 41A0A8 802A5318 00031040 */  sll       $v0, $v1, 1
/* 41A0AC 802A531C 00431021 */  addu      $v0, $v0, $v1
/* 41A0B0 802A5320 00021080 */  sll       $v0, $v0, 2
/* 41A0B4 802A5324 00438821 */  addu      $s1, $v0, $v1
/* 41A0B8 802A5328 02281023 */  subu      $v0, $s1, $t0
/* 41A0BC 802A532C 44820000 */  mtc1      $v0, $f0
/* 41A0C0 802A5330 00000000 */  nop
/* 41A0C4 802A5334 46800021 */  cvt.d.w   $f0, $f0
/* 41A0C8 802A5338 46220002 */  mul.d     $f0, $f0, $f2
/* 41A0CC 802A533C 00000000 */  nop
/* 41A0D0 802A5340 4620018D */  trunc.w.d $f6, $f0
/* 41A0D4 802A5344 44023000 */  mfc1      $v0, $f6
/* 41A0D8 802A5348 00000000 */  nop
/* 41A0DC 802A534C 14400002 */  bnez      $v0, .L802A5358_7ACCF8
/* 41A0E0 802A5350 01024021 */   addu     $t0, $t0, $v0
/* 41A0E4 802A5354 0220402D */  daddu     $t0, $s1, $zero
.L802A5358_7ACCF8:
/* 41A0E8 802A5358 26F50004 */  addiu     $s5, $s7, 0x4
/* 41A0EC 802A535C 44951000 */  mtc1      $s5, $f2
/* 41A0F0 802A5360 00000000 */  nop
/* 41A0F4 802A5364 468010A0 */  cvt.s.w   $f2, $f2
/* 41A0F8 802A5368 26F50021 */  addiu     $s5, $s7, 0x21
/* 41A0FC 802A536C 0000B02D */  daddu     $s6, $zero, $zero
/* 41A100 802A5370 02C0982D */  daddu     $s3, $s6, $zero
/* 41A104 802A5374 3C06800A */  lui       $a2, %hi(gMainGfxPos)
/* 41A108 802A5378 24C6A66C */  addiu     $a2, $a2, %lo(gMainGfxPos)
/* 41A10C 802A537C 8FA90048 */  lw        $t1, 0x48($sp)
/* 41A110 802A5380 8CC40000 */  lw        $a0, 0x0($a2)
/* 41A114 802A5384 3C03802B */  lui       $v1, %hi(D_802AD60A)
/* 41A118 802A5388 8063D60A */  lb        $v1, %lo(D_802AD60A)($v1)
/* 41A11C 802A538C 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 41A120 802A5390 44812000 */  mtc1      $at, $f4
/* 41A124 802A5394 3C05802B */  lui       $a1, %hi(D_802AD60C)
/* 41A128 802A5398 24A5D60C */  addiu     $a1, $a1, %lo(D_802AD60C)
/* 41A12C 802A539C A4A80000 */  sh        $t0, 0x0($a1)
/* 41A130 802A53A0 25310012 */  addiu     $s1, $t1, 0x12
/* 41A134 802A53A4 00031040 */  sll       $v0, $v1, 1
/* 41A138 802A53A8 00431021 */  addu      $v0, $v0, $v1
/* 41A13C 802A53AC 00021080 */  sll       $v0, $v0, 2
/* 41A140 802A53B0 00431021 */  addu      $v0, $v0, $v1
/* 41A144 802A53B4 24420001 */  addiu     $v0, $v0, 0x1
/* 41A148 802A53B8 02224021 */  addu      $t0, $s1, $v0
/* 41A14C 802A53BC 46041082 */  mul.s     $f2, $f2, $f4
/* 41A150 802A53C0 00000000 */  nop
/* 41A154 802A53C4 0080382D */  daddu     $a3, $a0, $zero
/* 41A158 802A53C8 24840008 */  addiu     $a0, $a0, 0x8
/* 41A15C 802A53CC 44910000 */  mtc1      $s1, $f0
/* 41A160 802A53D0 00000000 */  nop
/* 41A164 802A53D4 46800020 */  cvt.s.w   $f0, $f0
/* 41A168 802A53D8 84A20000 */  lh        $v0, 0x0($a1)
/* 41A16C 802A53DC 46040002 */  mul.s     $f0, $f0, $f4
/* 41A170 802A53E0 00000000 */  nop
/* 41A174 802A53E4 ACC40000 */  sw        $a0, 0x0($a2)
/* 41A178 802A53E8 24420013 */  addiu     $v0, $v0, 0x13
/* 41A17C 802A53EC 01228821 */  addu      $s1, $t1, $v0
/* 41A180 802A53F0 26E2008E */  addiu     $v0, $s7, 0x8E
/* 41A184 802A53F4 4600118D */  trunc.w.s $f6, $f2
/* 41A188 802A53F8 44033000 */  mfc1      $v1, $f6
/* 41A18C 802A53FC 00000000 */  nop
/* 41A190 802A5400 30630FFF */  andi      $v1, $v1, 0xFFF
/* 41A194 802A5404 00031B00 */  sll       $v1, $v1, 12
/* 41A198 802A5408 4600018D */  trunc.w.s $f6, $f0
/* 41A19C 802A540C 44043000 */  mfc1      $a0, $f6
/* 41A1A0 802A5410 00000000 */  nop
/* 41A1A4 802A5414 30840FFF */  andi      $a0, $a0, 0xFFF
/* 41A1A8 802A5418 44821000 */  mtc1      $v0, $f2
/* 41A1AC 802A541C 00000000 */  nop
/* 41A1B0 802A5420 468010A0 */  cvt.s.w   $f2, $f2
/* 41A1B4 802A5424 3C02ED00 */  lui       $v0, (0xED000000 >> 16)
/* 41A1B8 802A5428 46041082 */  mul.s     $f2, $f2, $f4
/* 41A1BC 802A542C 00000000 */  nop
/* 41A1C0 802A5430 00822025 */  or        $a0, $a0, $v0
/* 41A1C4 802A5434 00641825 */  or        $v1, $v1, $a0
/* 41A1C8 802A5438 44880000 */  mtc1      $t0, $f0
/* 41A1CC 802A543C 00000000 */  nop
/* 41A1D0 802A5440 46800020 */  cvt.s.w   $f0, $f0
/* 41A1D4 802A5444 3C04802B */  lui       $a0, %hi(D_802AD66C)
/* 41A1D8 802A5448 8C84D66C */  lw        $a0, %lo(D_802AD66C)($a0)
/* 41A1DC 802A544C 46040002 */  mul.s     $f0, $f0, $f4
/* 41A1E0 802A5450 00000000 */  nop
/* 41A1E4 802A5454 ACE30000 */  sw        $v1, 0x0($a3)
/* 41A1E8 802A5458 4600118D */  trunc.w.s $f6, $f2
/* 41A1EC 802A545C 44023000 */  mfc1      $v0, $f6
D_802A5460_7ACE00:
/* 41A1F0 802A5460 00000000 */  nop
/* 41A1F4 802A5464 30420FFF */  andi      $v0, $v0, 0xFFF
/* 41A1F8 802A5468 00021300 */  sll       $v0, $v0, 12
/* 41A1FC 802A546C 4600018D */  trunc.w.s $f6, $f0
/* 41A200 802A5470 44033000 */  mfc1      $v1, $f6
/* 41A204 802A5474 00000000 */  nop
/* 41A208 802A5478 30630FFF */  andi      $v1, $v1, 0xFFF
/* 41A20C 802A547C 00431025 */  or        $v0, $v0, $v1
/* 41A210 802A5480 18800028 */  blez      $a0, .L802A5524_7ACEC4
/* 41A214 802A5484 ACE20004 */   sw       $v0, 0x4($a3)
/* 41A218 802A5488 241E0001 */  addiu     $fp, $zero, 0x1
/* 41A21C 802A548C 3C14802B */  lui       $s4, %hi(D_802AD690)
/* 41A220 802A5490 2694D690 */  addiu     $s4, $s4, %lo(D_802AD690)
/* 41A224 802A5494 3C12802B */  lui       $s2, %hi(D_802AD678)
/* 41A228 802A5498 2652D678 */  addiu     $s2, $s2, %lo(D_802AD678)
.L802A549C_7ACE3C:
/* 41A22C 802A549C 24090005 */  addiu     $t1, $zero, 0x5
/* 41A230 802A54A0 8E420000 */  lw        $v0, 0x0($s2)
/* 41A234 802A54A4 3C10802B */  lui       $s0, %hi(D_802AD614)
/* 41A238 802A54A8 8210D614 */  lb        $s0, %lo(D_802AD614)($s0)
/* 41A23C 802A54AC 14490005 */  bne       $v0, $t1, .L802A54C4_7ACE64
/* 41A240 802A54B0 00000000 */   nop
/* 41A244 802A54B4 0C03A752 */  jal       is_ability_active
/* 41A248 802A54B8 2404001A */   addiu    $a0, $zero, 0x1A
/* 41A24C 802A54BC 54400001 */  bnel      $v0, $zero, .L802A54C4_7ACE64
/* 41A250 802A54C0 24100037 */   addiu    $s0, $zero, 0x37
.L802A54C4_7ACE64:
/* 41A254 802A54C4 8E820000 */  lw        $v0, 0x0($s4)
/* 41A258 802A54C8 14400002 */  bnez      $v0, .L802A54D4_7ACE74
/* 41A25C 802A54CC 00161880 */   sll      $v1, $s6, 2
/* 41A260 802A54D0 2410000B */  addiu     $s0, $zero, 0xB
.L802A54D4_7ACE74:
/* 41A264 802A54D4 02A0282D */  daddu     $a1, $s5, $zero
D_802A54D8_7ACE78:
/* 41A268 802A54D8 0220302D */  daddu     $a2, $s1, $zero
/* 41A26C 802A54DC 2631000D */  addiu     $s1, $s1, 0xD
/* 41A270 802A54E0 26520004 */  addiu     $s2, $s2, 0x4
/* 41A274 802A54E4 26730001 */  addiu     $s3, $s3, 0x1
/* 41A278 802A54E8 3C09802B */  lui       $t1, %hi(D_802AD658)
/* 41A27C 802A54EC 2529D658 */  addiu     $t1, $t1, %lo(D_802AD658)
/* 41A280 802A54F0 00691021 */  addu      $v0, $v1, $t1
/* 41A284 802A54F4 AFB00010 */  sw        $s0, 0x10($sp)
/* 41A288 802A54F8 AFBE0014 */  sw        $fp, 0x14($sp)
/* 41A28C 802A54FC 8C440000 */  lw        $a0, 0x0($v0)
/* 41A290 802A5500 3C07802B */  lui       $a3, %hi(D_802AD624)
/* 41A294 802A5504 8CE7D624 */  lw        $a3, %lo(D_802AD624)($a3)
/* 41A298 802A5508 0C04993B */  jal       draw_msg
/* 41A29C 802A550C 26940004 */   addiu    $s4, $s4, 0x4
/* 41A2A0 802A5510 3C02802B */  lui       $v0, %hi(D_802AD66C)
/* 41A2A4 802A5514 8C42D66C */  lw        $v0, %lo(D_802AD66C)($v0)
/* 41A2A8 802A5518 0262102A */  slt       $v0, $s3, $v0
/* 41A2AC 802A551C 1440FFDF */  bnez      $v0, .L802A549C_7ACE3C
D_802A5520_7ACEC0:
/* 41A2B0 802A5520 26D60001 */   addiu    $s6, $s6, 0x1
.L802A5524_7ACEC4:
/* 41A2B4 802A5524 26F50018 */  addiu     $s5, $s7, 0x18
/* 41A2B8 802A5528 0000982D */  daddu     $s3, $zero, $zero
/* 41A2BC 802A552C 3C02802B */  lui       $v0, %hi(D_802AD60C)
D_802A5530_7ACED0:
/* 41A2C0 802A5530 8442D60C */  lh        $v0, %lo(D_802AD60C)($v0)
/* 41A2C4 802A5534 8FA90048 */  lw        $t1, 0x48($sp)
/* 41A2C8 802A5538 3C03802B */  lui       $v1, %hi(D_802AD66C)
/* 41A2CC 802A553C 8C63D66C */  lw        $v1, %lo(D_802AD66C)($v1)
D_802A5540_7ACEE0:
/* 41A2D0 802A5540 00491021 */  addu      $v0, $v0, $t1
/* 41A2D4 802A5544 18600015 */  blez      $v1, .L802A559C_7ACF3C
/* 41A2D8 802A5548 24510018 */   addiu    $s1, $v0, 0x18
/* 41A2DC 802A554C 3C12802B */  lui       $s2, %hi(D_802AD628)
/* 41A2E0 802A5550 2652D628 */  addiu     $s2, $s2, %lo(D_802AD628)
.L802A5554_7ACEF4:
/* 41A2E4 802A5554 02A0282D */  daddu     $a1, $s5, $zero
/* 41A2E8 802A5558 0220302D */  daddu     $a2, $s1, $zero
/* 41A2EC 802A555C 2631000D */  addiu     $s1, $s1, 0xD
/* 41A2F0 802A5560 8E500000 */  lw        $s0, 0x0($s2)
/* 41A2F4 802A5564 26730001 */  addiu     $s3, $s3, 0x1
/* 41A2F8 802A5568 0C051261 */  jal       hud_element_set_render_pos
/* 41A2FC 802A556C 0200202D */   daddu    $a0, $s0, $zero
/* 41A300 802A5570 3C05802B */  lui       $a1, %hi(D_802AD624)
/* 41A304 802A5574 8CA5D624 */  lw        $a1, %lo(D_802AD624)($a1)
/* 41A308 802A5578 0C0513AC */  jal       hud_element_set_alpha
/* 41A30C 802A557C 0200202D */   daddu    $a0, $s0, $zero
D_802A5580_7ACF20:
/* 41A310 802A5580 0C0511F8 */  jal       hud_element_draw_without_clipping
/* 41A314 802A5584 0200202D */   daddu    $a0, $s0, $zero
/* 41A318 802A5588 3C02802B */  lui       $v0, %hi(D_802AD66C)
/* 41A31C 802A558C 8C42D66C */  lw        $v0, %lo(D_802AD66C)($v0)
/* 41A320 802A5590 0262102A */  slt       $v0, $s3, $v0
/* 41A324 802A5594 1440FFEF */  bnez      $v0, .L802A5554_7ACEF4
/* 41A328 802A5598 26520004 */   addiu    $s2, $s2, 0x4
.L802A559C_7ACF3C:
/* 41A32C 802A559C 3C03802B */  lui       $v1, %hi(D_802AD605)
/* 41A330 802A55A0 8063D605 */  lb        $v1, %lo(D_802AD605)($v1)
/* 41A334 802A55A4 3C02802B */  lui       $v0, %hi(D_802AD608)
/* 41A338 802A55A8 8042D608 */  lb        $v0, %lo(D_802AD608)($v0)
/* 41A33C 802A55AC 3C08802B */  lui       $t0, %hi(D_802AD60E)
/* 41A340 802A55B0 8508D60E */  lh        $t0, %lo(D_802AD60E)($t0)
/* 41A344 802A55B4 00621823 */  subu      $v1, $v1, $v0
/* 41A348 802A55B8 00031040 */  sll       $v0, $v1, 1
/* 41A34C 802A55BC 00431021 */  addu      $v0, $v0, $v1
/* 41A350 802A55C0 00021080 */  sll       $v0, $v0, 2
/* 41A354 802A55C4 00438821 */  addu      $s1, $v0, $v1
/* 41A358 802A55C8 02281023 */  subu      $v0, $s1, $t0
/* 41A35C 802A55CC 44820000 */  mtc1      $v0, $f0
/* 41A360 802A55D0 00000000 */  nop
/* 41A364 802A55D4 46800021 */  cvt.d.w   $f0, $f0
/* 41A368 802A55D8 4620018D */  trunc.w.d $f6, $f0
/* 41A36C 802A55DC 44023000 */  mfc1      $v0, $f6
/* 41A370 802A55E0 00000000 */  nop
/* 41A374 802A55E4 10400003 */  beqz      $v0, .L802A55F4_7ACF94
/* 41A378 802A55E8 26F5000A */   addiu    $s5, $s7, 0xA
/* 41A37C 802A55EC 080A957E */  j         .L802A55F8_7ACF98
/* 41A380 802A55F0 01024021 */   addu     $t0, $t0, $v0
.L802A55F4_7ACF94:
/* 41A384 802A55F4 0220402D */  daddu     $t0, $s1, $zero
.L802A55F8_7ACF98:
/* 41A388 802A55F8 02A0282D */  daddu     $a1, $s5, $zero
/* 41A38C 802A55FC 00083400 */  sll       $a2, $t0, 16
/* 41A390 802A5600 00063403 */  sra       $a2, $a2, 16
/* 41A394 802A5604 3C10802B */  lui       $s0, %hi(D_802AD618)
/* 41A398 802A5608 8E10D618 */  lw        $s0, %lo(D_802AD618)($s0)
/* 41A39C 802A560C 8FA90048 */  lw        $t1, 0x48($sp)
/* 41A3A0 802A5610 24C6001A */  addiu     $a2, $a2, 0x1A
/* 41A3A4 802A5614 3C01802B */  lui       $at, %hi(D_802AD60E)
/* 41A3A8 802A5618 A428D60E */  sh        $t0, %lo(D_802AD60E)($at)
/* 41A3AC 802A561C 01263021 */  addu      $a2, $t1, $a2
/* 41A3B0 802A5620 0C051261 */  jal       hud_element_set_render_pos
/* 41A3B4 802A5624 0200202D */   daddu    $a0, $s0, $zero
/* 41A3B8 802A5628 3C11802B */  lui       $s1, %hi(D_802AD624)
/* 41A3BC 802A562C 2631D624 */  addiu     $s1, $s1, %lo(D_802AD624)
/* 41A3C0 802A5630 8E250000 */  lw        $a1, 0x0($s1)
/* 41A3C4 802A5634 0C0513AC */  jal       hud_element_set_alpha
/* 41A3C8 802A5638 0200202D */   daddu    $a0, $s0, $zero
/* 41A3CC 802A563C 0C0511EA */  jal       hud_element_draw_clipped
/* 41A3D0 802A5640 0200202D */   daddu    $a0, $s0, $zero
/* 41A3D4 802A5644 3C02802B */  lui       $v0, %hi(D_802AD608)
/* 41A3D8 802A5648 8042D608 */  lb        $v0, %lo(D_802AD608)($v0)
/* 41A3DC 802A564C 1840000C */  blez      $v0, .L802A5680_7AD020
/* 41A3E0 802A5650 26E50043 */   addiu    $a1, $s7, 0x43
/* 41A3E4 802A5654 8FA90048 */  lw        $t1, 0x48($sp)
/* 41A3E8 802A5658 3C10802B */  lui       $s0, %hi(GreenArrowUpID)
/* 41A3EC 802A565C 8E10D61C */  lw        $s0, %lo(GreenArrowUpID)($s0)
/* 41A3F0 802A5660 25260010 */  addiu     $a2, $t1, 0x10
/* 41A3F4 802A5664 0C051261 */  jal       hud_element_set_render_pos
/* 41A3F8 802A5668 0200202D */   daddu    $a0, $s0, $zero
/* 41A3FC 802A566C 8E250000 */  lw        $a1, 0x0($s1)
/* 41A400 802A5670 0C0513AC */  jal       hud_element_set_alpha
/* 41A404 802A5674 0200202D */   daddu    $a0, $s0, $zero
/* 41A408 802A5678 0C0511EA */  jal       hud_element_draw_clipped
/* 41A40C 802A567C 0200202D */   daddu    $a0, $s0, $zero
.L802A5680_7AD020:
/* 41A410 802A5680 3C02802B */  lui       $v0, %hi(D_802AD609)
/* 41A414 802A5684 8042D609 */  lb        $v0, %lo(D_802AD609)($v0)
/* 41A418 802A5688 3C03802B */  lui       $v1, %hi(D_802AD66C)
/* 41A41C 802A568C 8C63D66C */  lw        $v1, %lo(D_802AD66C)($v1)
/* 41A420 802A5690 0043102A */  slt       $v0, $v0, $v1
/* 41A424 802A5694 1040000C */  beqz      $v0, .L802A56C8_7AD068
/* 41A428 802A5698 26E50043 */   addiu    $a1, $s7, 0x43
/* 41A42C 802A569C 8FA90048 */  lw        $t1, 0x48($sp)
/* 41A430 802A56A0 3C10802B */  lui       $s0, %hi(GreenArrowDownID)
/* 41A434 802A56A4 8E10D620 */  lw        $s0, %lo(GreenArrowDownID)($s0)
/* 41A438 802A56A8 25260064 */  addiu     $a2, $t1, 0x64
/* 41A43C 802A56AC 0C051261 */  jal       hud_element_set_render_pos
/* 41A440 802A56B0 0200202D */   daddu    $a0, $s0, $zero
/* 41A444 802A56B4 8E250000 */  lw        $a1, 0x0($s1)
/* 41A448 802A56B8 0C0513AC */  jal       hud_element_set_alpha
/* 41A44C 802A56BC 0200202D */   daddu    $a0, $s0, $zero
/* 41A450 802A56C0 0C0511EA */  jal       hud_element_draw_clipped
/* 41A454 802A56C4 0200202D */   daddu    $a0, $s0, $zero
glabel .L802A56C8_7AD068
/* 41A458 802A56C8 8FBF003C */  lw        $ra, 0x3C($sp)
/* 41A45C 802A56CC 8FBE0038 */  lw        $fp, 0x38($sp)
/* 41A460 802A56D0 8FB70034 */  lw        $s7, 0x34($sp)
/* 41A464 802A56D4 8FB60030 */  lw        $s6, 0x30($sp)
/* 41A468 802A56D8 8FB5002C */  lw        $s5, 0x2C($sp)
/* 41A46C 802A56DC 8FB40028 */  lw        $s4, 0x28($sp)
/* 41A470 802A56E0 8FB30024 */  lw        $s3, 0x24($sp)
/* 41A474 802A56E4 8FB20020 */  lw        $s2, 0x20($sp)
/* 41A478 802A56E8 8FB1001C */  lw        $s1, 0x1C($sp)
/* 41A47C 802A56EC 8FB00018 */  lw        $s0, 0x18($sp)
/* 41A480 802A56F0 03E00008 */  jr        $ra
/* 41A484 802A56F4 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void func_802A5290(void* data, s32 x, s32 y) {
    s32 var_t0;
    s32 temp_f6;
    s32 xPos, yPos;
    s32 idx;
    s32 id;
    s32 i;

    switch (BattleSubmenuStratsState) {
        case -1:
        case 1:
        case 10:
        case 20:
        case 30:
        case 40:
        case 41:
            yPos = -D_802AD608 * 13;
            var_t0 = D_802AD60C;
            temp_f6 = (yPos - var_t0) * 0.5;
            if (temp_f6 != 0) {
                var_t0 += temp_f6;
            } else {
                var_t0 = yPos;
            }
            D_802AD60C = var_t0;

            xPos = x + 4;
            yPos = y + 18;
            var_t0 = yPos + 1 + (D_802AD60A * 13);
            gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, xPos, yPos, x + 142, var_t0);

            xPos = x + 33;
            yPos = y + 19 + D_802AD60C;

            idx = 0;
            for (i = 0; i < D_802AD66C; i++, idx++) {
                s32 palette = D_802AD614;

                if (D_802AD678[i] == 5 && is_ability_active(ABILITY_QUICK_CHANGE)) {
                    palette = MSG_PAL_37;
                }
                if (D_802AD690[idx] == 0) {
                    palette = MSG_PAL_0B;
                }
                draw_msg(D_802AD658[idx], xPos, yPos, D_802AD624, palette, DRAW_MSG_STYLE_MENU);
                yPos += 13;
            }

            xPos = x + 24;
            yPos = D_802AD60C + y + 24;

            idx = 0;
            for (i = 0; i < D_802AD66C; i++, idx++) {
                id = D_802AD628[idx];
                hud_element_set_render_pos(id, xPos, yPos);
                hud_element_set_alpha(id, D_802AD624);
                hud_element_draw_without_clipping(id);
                yPos += 13;
            }

            yPos = (D_802AD605 - D_802AD608) * 13;
            var_t0 = D_802AD60E;
            temp_f6 = (yPos - var_t0) * 1.0;
            xPos = x + 10;
            if (temp_f6 != 0) {
                var_t0 += temp_f6;
            } else {
                var_t0 = yPos;
            }
            D_802AD60E = var_t0;
            yPos = y + 26 + D_802AD60E;

            id = D_802AD618;
            hud_element_set_render_pos(id, xPos, yPos);
            hud_element_set_alpha(id, D_802AD624);
            hud_element_draw_clipped(id);

            if (D_802AD608 > 0) {
                id = GreenArrowUpID;
                hud_element_set_render_pos(id, x + 67, y + 16);
                hud_element_set_alpha(id, D_802AD624);
                hud_element_draw_clipped(id);
            }
            if (D_802AD609 < D_802AD66C) {
                id = GreenArrowDownID;
                hud_element_set_render_pos(id, x + 67, y + 100);
                hud_element_set_alpha(id, D_802AD624);
                hud_element_draw_clipped(id);
            }
            break;
    }
}