### RAW ASSEMBLY INSTRUCTIONS:

glabel update_model_animator_with_transform
/* B5154 8011EA54 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* B5158 8011EA58 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* B515C 8011EA5C 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* B5160 8011EA60 AFBF001C */  sw        $ra, 0x1C($sp)
/* B5164 8011EA64 AFB20018 */  sw        $s2, 0x18($sp)
/* B5168 8011EA68 AFB10014 */  sw        $s1, 0x14($sp)
/* B516C 8011EA6C AFB00010 */  sw        $s0, 0x10($sp)
/* B5170 8011EA70 80420070 */  lb        $v0, 0x70($v0)
/* B5174 8011EA74 10400004 */  beqz      $v0, .L8011EA88
/* B5178 8011EA78 00A0882D */   daddu    $s1, $a1, $zero
/* B517C 8011EA7C 30820800 */  andi      $v0, $a0, 0x800
/* B5180 8011EA80 10400055 */  beqz      $v0, .L8011EBD8
/* B5184 8011EA84 00000000 */   nop
.L8011EA88:
/* B5188 8011EA88 2402F7FF */  addiu     $v0, $zero, -0x801
/* B518C 8011EA8C 00822024 */  and       $a0, $a0, $v0
/* B5190 8011EA90 3C038015 */  lui       $v1, %hi(gCurrentAnimMeshListPtr)
/* B5194 8011EA94 8C633A40 */  lw        $v1, %lo(gCurrentAnimMeshListPtr)($v1)
/* B5198 8011EA98 00041080 */  sll       $v0, $a0, 2
/* B519C 8011EA9C 00431021 */  addu      $v0, $v0, $v1
/* B51A0 8011EAA0 8C500000 */  lw        $s0, 0x0($v0)
/* B51A4 8011EAA4 1200004C */  beqz      $s0, .L8011EBD8
/* B51A8 8011EAA8 00000000 */   nop
/* B51AC 8011EAAC 8E040000 */  lw        $a0, 0x0($s0)
/* B51B0 8011EAB0 10800049 */  beqz      $a0, .L8011EBD8
/* B51B4 8011EAB4 3C020004 */   lui      $v0, (0x40000 >> 16)
/* B51B8 8011EAB8 00821024 */  and       $v0, $a0, $v0
/* B51BC 8011EABC 14400046 */  bnez      $v0, .L8011EBD8
/* B51C0 8011EAC0 0000182D */   daddu    $v1, $zero, $zero
/* B51C4 8011EAC4 C6000090 */  lwc1      $f0, 0x90($s0)
/* B51C8 8011EAC8 C6020094 */  lwc1      $f2, 0x94($s0)
/* B51CC 8011EACC 2402FFBF */  addiu     $v0, $zero, -0x41
/* B51D0 8011EAD0 46020001 */  sub.s     $f0, $f0, $f2
/* B51D4 8011EAD4 44801000 */  mtc1      $zero, $f2
/* B51D8 8011EAD8 00821024 */  and       $v0, $a0, $v0
/* B51DC 8011EADC AE020000 */  sw        $v0, 0x0($s0)
/* B51E0 8011EAE0 4602003E */  c.le.s    $f0, $f2
/* B51E4 8011EAE4 00000000 */  nop
/* B51E8 8011EAE8 45000014 */  bc1f      .L8011EB3C
/* B51EC 8011EAEC E6000090 */   swc1     $f0, 0x90($s0)
/* B51F0 8011EAF0 30428000 */  andi      $v0, $v0, 0x8000
/* B51F4 8011EAF4 14400008 */  bnez      $v0, .L8011EB18
/* B51F8 8011EAF8 0200202D */   daddu    $a0, $s0, $zero
.L8011EAFC:
/* B51FC 8011EAFC 0C047AFC */  jal       step_model_animator
/* B5200 8011EB00 0200202D */   daddu    $a0, $s0, $zero
/* B5204 8011EB04 0040182D */  daddu     $v1, $v0, $zero
/* B5208 8011EB08 1C60FFFC */  bgtz      $v1, .L8011EAFC
/* B520C 8011EB0C 2402FFFF */   addiu    $v0, $zero, -0x1
/* B5210 8011EB10 08047AD0 */  j         .L8011EB40
/* B5214 8011EB14 00000000 */   nop
.L8011EB18:
/* B5218 8011EB18 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* B521C 8011EB1C 44810000 */  mtc1      $at, $f0
/* B5220 8011EB20 0C04819E */  jal       reload_mesh_animator_tree
/* B5224 8011EB24 E6000090 */   swc1     $f0, 0x90($s0)
.L8011EB28:
/* B5228 8011EB28 0C0481BE */  jal       step_mesh_animator
/* B522C 8011EB2C 0200202D */   daddu    $a0, $s0, $zero
/* B5230 8011EB30 0040182D */  daddu     $v1, $v0, $zero
/* B5234 8011EB34 1C60FFFC */  bgtz      $v1, .L8011EB28
/* B5238 8011EB38 00000000 */   nop
.L8011EB3C:
/* B523C 8011EB3C 2402FFFF */  addiu     $v0, $zero, -0x1
.L8011EB40:
/* B5240 8011EB40 10620025 */  beq       $v1, $v0, .L8011EBD8
/* B5244 8011EB44 0200202D */   daddu    $a0, $s0, $zero
/* B5248 8011EB48 0C047C16 */  jal       animator_update_model_transforms
/* B524C 8011EB4C 0220282D */   daddu    $a1, $s1, $zero
/* B5250 8011EB50 0000882D */  daddu     $s1, $zero, $zero
/* B5254 8011EB54 2412FFFF */  addiu     $s2, $zero, -0x1
/* B5258 8011EB58 3C108015 */  lui       $s0, %hi(D_801533C0)
/* B525C 8011EB5C 261033C0 */  addiu     $s0, $s0, %lo(D_801533C0)
.L8011EB60:
/* B5260 8011EB60 8E020000 */  lw        $v0, 0x0($s0)
/* B5264 8011EB64 04420008 */  bltzl     $v0, .L8011EB88
/* B5268 8011EB68 26310001 */   addiu    $s1, $s1, 0x1
/* B526C 8011EB6C 2442FFFF */  addiu     $v0, $v0, -0x1
/* B5270 8011EB70 14400004 */  bnez      $v0, .L8011EB84
/* B5274 8011EB74 AE020000 */   sw       $v0, 0x0($s0)
/* B5278 8011EB78 8E040004 */  lw        $a0, 0x4($s0)
/* B527C 8011EB7C 0C00AB1E */  jal       general_heap_free
/* B5280 8011EB80 AE120000 */   sw       $s2, 0x0($s0)
.L8011EB84:
/* B5284 8011EB84 26310001 */  addiu     $s1, $s1, 0x1
.L8011EB88:
/* B5288 8011EB88 2A220060 */  slti      $v0, $s1, 0x60
/* B528C 8011EB8C 1440FFF4 */  bnez      $v0, .L8011EB60
/* B5290 8011EB90 26100008 */   addiu    $s0, $s0, 0x8
/* B5294 8011EB94 0000882D */  daddu     $s1, $zero, $zero
/* B5298 8011EB98 2412FFFF */  addiu     $s2, $zero, -0x1
/* B529C 8011EB9C 3C108015 */  lui       $s0, %hi(D_801536C0)
/* B52A0 8011EBA0 261036C0 */  addiu     $s0, $s0, %lo(D_801536C0)
.L8011EBA4:
/* B52A4 8011EBA4 8E020000 */  lw        $v0, 0x0($s0)
/* B52A8 8011EBA8 04420008 */  bltzl     $v0, .L8011EBCC
/* B52AC 8011EBAC 26310001 */   addiu    $s1, $s1, 0x1
/* B52B0 8011EBB0 2442FFFF */  addiu     $v0, $v0, -0x1
/* B52B4 8011EBB4 14400004 */  bnez      $v0, .L8011EBC8
/* B52B8 8011EBB8 AE020000 */   sw       $v0, 0x0($s0)
/* B52BC 8011EBBC 8E040004 */  lw        $a0, 0x4($s0)
/* B52C0 8011EBC0 0C00AB1E */  jal       general_heap_free
/* B52C4 8011EBC4 AE120000 */   sw       $s2, 0x0($s0)
.L8011EBC8:
/* B52C8 8011EBC8 26310001 */  addiu     $s1, $s1, 0x1
.L8011EBCC:
/* B52CC 8011EBCC 2A220060 */  slti      $v0, $s1, 0x60
/* B52D0 8011EBD0 1440FFF4 */  bnez      $v0, .L8011EBA4
/* B52D4 8011EBD4 26100008 */   addiu    $s0, $s0, 0x8
.L8011EBD8:
/* B52D8 8011EBD8 8FBF001C */  lw        $ra, 0x1C($sp)
/* B52DC 8011EBDC 8FB20018 */  lw        $s2, 0x18($sp)
/* B52E0 8011EBE0 8FB10014 */  lw        $s1, 0x14($sp)
/* B52E4 8011EBE4 8FB00010 */  lw        $s0, 0x10($sp)
/* B52E8 8011EBE8 03E00008 */  jr        $ra
/* B52EC 8011EBEC 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void update_model_animator_with_transform(s32 animatorID, Mtx* mtx) {
    if (!gGameStatusPtr->isBattle || animatorID & 0x800) {
        ModelAnimator* animator;

        animatorID &= ~0x800;
        animator = (*gCurrentAnimMeshListPtr)[animatorID];

        if (animator != NULL && animator->flags != 0) {
            s32 temp = 0;

            if (!(animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION)) {
                animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
                animator->nextUpdateTime -= animator->timeScale;
                if (animator->nextUpdateTime <= 0.0f) {
                    if (!(animator->flags & MODEL_ANIMATOR_FLAG_MESH)) {
                        do {
                            temp = step_model_animator(animator);
                        } while (temp > 0);
                    } else {
                        animator->nextUpdateTime = 1.0f;
                        reload_mesh_animator_tree(animator);
                        do {
                            temp = step_mesh_animator(animator);
                        } while (temp > 0);
                    }
                }

                if (temp != -1) {
                    s32 i;

                    animator_update_model_transforms(animator, mtx);

                    for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
                        if (D_801533C0[i].ttl >= 0) {
                            D_801533C0[i].ttl--;
                            if (D_801533C0[i].ttl == 0) {
                                D_801533C0[i].ttl = -1;
                                general_heap_free(D_801533C0[i].addr);
                            }
                        }
                    }

                    for (i = 0; i < ARRAY_COUNT(D_801536C0); i++) {
                        if (D_801536C0[i].ttl >= 0) {
                            D_801536C0[i].ttl--;
                            if (D_801536C0[i].ttl == 0) {
                                D_801536C0[i].ttl = -1;
                                general_heap_free(D_801536C0[i].addr);
                            }
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8025CD40
/* 18B620 8025CD40 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 18B624 8025CD44 AFB10014 */  sw        $s1, 0x14($sp)
/* 18B628 8025CD48 00A0882D */  daddu     $s1, $a1, $zero
/* 18B62C 8025CD4C AFBF0020 */  sw        $ra, 0x20($sp)
/* 18B630 8025CD50 AFB3001C */  sw        $s3, 0x1C($sp)
/* 18B634 8025CD54 AFB20018 */  sw        $s2, 0x18($sp)
/* 18B638 8025CD58 AFB00010 */  sw        $s0, 0x10($sp)
/* 18B63C 8025CD5C 8E3000C0 */  lw        $s0, 0xC0($s1)
/* 18B640 8025CD60 82020765 */  lb        $v0, 0x765($s0)
/* 18B644 8025CD64 10400017 */  beqz      $v0, .L8025CDC4
/* 18B648 8025CD68 00E0982D */   daddu    $s3, $a3, $zero
/* 18B64C 8025CD6C 0C095094 */  jal       func_80254250
/* 18B650 8025CD70 0220202D */   daddu    $a0, $s1, $zero
/* 18B654 8025CD74 0040182D */  daddu     $v1, $v0, $zero
/* 18B658 8025CD78 24040001 */  addiu     $a0, $zero, 0x1
/* 18B65C 8025CD7C 10640008 */  beq       $v1, $a0, .L8025CDA0
/* 18B660 8025CD80 28620002 */   slti     $v0, $v1, 0x2
/* 18B664 8025CD84 1040000A */  beqz      $v0, .L8025CDB0
/* 18B668 8025CD88 2402000E */   addiu    $v0, $zero, 0xE
/* 18B66C 8025CD8C 54600009 */  bnel      $v1, $zero, .L8025CDB4
/* 18B670 8025CD90 A2020767 */   sb       $v0, 0x767($s0)
/* 18B674 8025CD94 A2040767 */  sb        $a0, 0x767($s0)
/* 18B678 8025CD98 0809736F */  j         .L8025CDBC
/* 18B67C 8025CD9C A2000766 */   sb       $zero, 0x766($s0)
.L8025CDA0:
/* 18B680 8025CDA0 24020008 */  addiu     $v0, $zero, 0x8
/* 18B684 8025CDA4 A2020767 */  sb        $v0, 0x767($s0)
/* 18B688 8025CDA8 0809736F */  j         .L8025CDBC
/* 18B68C 8025CDAC A2030766 */   sb       $v1, 0x766($s0)
.L8025CDB0:
/* 18B690 8025CDB0 A2020767 */  sb        $v0, 0x767($s0)
.L8025CDB4:
/* 18B694 8025CDB4 24020002 */  addiu     $v0, $zero, 0x2
/* 18B698 8025CDB8 A2020766 */  sb        $v0, 0x766($s0)
.L8025CDBC:
/* 18B69C 8025CDBC A2000768 */  sb        $zero, 0x768($s0)
/* 18B6A0 8025CDC0 A2000765 */  sb        $zero, 0x765($s0)
.L8025CDC4:
/* 18B6A4 8025CDC4 82020766 */  lb        $v0, 0x766($s0)
/* 18B6A8 8025CDC8 24120003 */  addiu     $s2, $zero, 0x3
/* 18B6AC 8025CDCC 14520004 */  bne       $v0, $s2, .L8025CDE0
/* 18B6B0 8025CDD0 00000000 */   nop
/* 18B6B4 8025CDD4 A2000768 */  sb        $zero, 0x768($s0)
/* 18B6B8 8025CDD8 0C099C27 */  jal       func_8026709C
/* 18B6BC 8025CDDC 0220202D */   daddu    $a0, $s1, $zero
.L8025CDE0:
/* 18B6C0 8025CDE0 82030766 */  lb        $v1, 0x766($s0)
/* 18B6C4 8025CDE4 24020001 */  addiu     $v0, $zero, 0x1
/* 18B6C8 8025CDE8 10620012 */  beq       $v1, $v0, .L8025CE34
/* 18B6CC 8025CDEC 28620002 */   slti     $v0, $v1, 0x2
/* 18B6D0 8025CDF0 50400005 */  beql      $v0, $zero, .L8025CE08
/* 18B6D4 8025CDF4 24020002 */   addiu    $v0, $zero, 0x2
/* 18B6D8 8025CDF8 10600007 */  beqz      $v1, .L8025CE18
/* 18B6DC 8025CDFC 00000000 */   nop
/* 18B6E0 8025CE00 080973AB */  j         .L8025CEAC
/* 18B6E4 8025CE04 00000000 */   nop
.L8025CE08:
/* 18B6E8 8025CE08 10620013 */  beq       $v1, $v0, .L8025CE58
/* 18B6EC 8025CE0C 00000000 */   nop
/* 18B6F0 8025CE10 080973AB */  j         .L8025CEAC
/* 18B6F4 8025CE14 00000000 */   nop
.L8025CE18:
/* 18B6F8 8025CE18 82020767 */  lb        $v0, 0x767($s0)
/* 18B6FC 8025CE1C 5440001E */  bnel      $v0, $zero, .L8025CE98
/* 18B700 8025CE20 A2000768 */   sb       $zero, 0x768($s0)
/* 18B704 8025CE24 240200FF */  addiu     $v0, $zero, 0xFF
/* 18B708 8025CE28 A2020768 */  sb        $v0, 0x768($s0)
/* 18B70C 8025CE2C 080973AB */  j         .L8025CEAC
/* 18B710 8025CE30 A2120766 */   sb       $s2, 0x766($s0)
.L8025CE34:
/* 18B714 8025CE34 82030767 */  lb        $v1, 0x767($s0)
/* 18B718 8025CE38 2C620009 */  sltiu     $v0, $v1, 0x9
/* 18B71C 8025CE3C 10400016 */  beqz      $v0, .L8025CE98
/* 18B720 8025CE40 00031080 */   sll      $v0, $v1, 2
/* 18B724 8025CE44 3C01802A */  lui       $at, %hi(jtbl_8029D420)
/* 18B728 8025CE48 00220821 */  addu      $at, $at, $v0
/* 18B72C 8025CE4C 8C22D420 */  lw        $v0, %lo(jtbl_8029D420)($at)
/* 18B730 8025CE50 00400008 */  jr        $v0
/* 18B734 8025CE54 00000000 */   nop
.L8025CE58:
/* 18B738 8025CE58 82030767 */  lb        $v1, 0x767($s0)
/* 18B73C 8025CE5C 2C62000F */  sltiu     $v0, $v1, 0xF
/* 18B740 8025CE60 1040000D */  beqz      $v0, .L8025CE98
/* 18B744 8025CE64 00031080 */   sll      $v0, $v1, 2
/* 18B748 8025CE68 3C01802A */  lui       $at, %hi(jtbl_8029D448)
/* 18B74C 8025CE6C 00220821 */  addu      $at, $at, $v0
/* 18B750 8025CE70 8C22D448 */  lw        $v0, %lo(jtbl_8029D448)($at)
/* 18B754 8025CE74 00400008 */  jr        $v0
/* 18B758 8025CE78 00000000 */   nop
glabel .L8025CE7C
/* 18B75C 8025CE7C 080973A6 */  j         .L8025CE98
/* 18B760 8025CE80 A2000768 */   sb       $zero, 0x768($s0)
glabel .L8025CE84
/* 18B764 8025CE84 240200FF */  addiu     $v0, $zero, 0xFF
/* 18B768 8025CE88 080973A6 */  j         .L8025CE98
/* 18B76C 8025CE8C A2020768 */   sb       $v0, 0x768($s0)
glabel .L8025CE90
/* 18B770 8025CE90 24020003 */  addiu     $v0, $zero, 0x3
/* 18B774 8025CE94 A2020766 */  sb        $v0, 0x766($s0)
.L8025CE98:
/* 18B778 8025CE98 16600004 */  bnez      $s3, .L8025CEAC
/* 18B77C 8025CE9C 00000000 */   nop
/* 18B780 8025CEA0 92020767 */  lbu       $v0, 0x767($s0)
/* 18B784 8025CEA4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 18B788 8025CEA8 A2020767 */  sb        $v0, 0x767($s0)
.L8025CEAC:
/* 18B78C 8025CEAC 8FBF0020 */  lw        $ra, 0x20($sp)
/* 18B790 8025CEB0 8FB3001C */  lw        $s3, 0x1C($sp)
/* 18B794 8025CEB4 8FB20018 */  lw        $s2, 0x18($sp)
/* 18B798 8025CEB8 8FB10014 */  lw        $s1, 0x14($sp)
/* 18B79C 8025CEBC 8FB00010 */  lw        $s0, 0x10($sp)
/* 18B7A0 8025CEC0 03E00008 */  jr        $ra
/* 18B7A4 8025CEC4 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void func_8025CD40(s32 arg0, ActorPart* part, s32 yaw, s32 arg3) {
    DecorationTable* decor = part->decorationTable;

    if (decor->unk_765 != 0) {
        switch (func_80254250(part)) {
            case 0:
                decor->unk_767 = 1;
                decor->unk_766 = 0;
                break;
            case 1:
                decor->unk_767 = 8;
                decor->unk_766 = 1;
                break;
            case 2:
            default:
                decor->unk_767 = 0xE;
                decor->unk_766 = 2;
                break;
        }
        decor->unk_768 = 0;
        decor->unk_765 = 0;
    }

    if (decor->unk_766 == 3) {
        decor->unk_768 = 0;
        func_8026709C(part);
    }

    switch (decor->unk_766) {
        case 0:
            switch (decor->unk_767) {
                case 0:
                    decor->unk_768 = -1;
                    decor->unk_766 = 3;
                    break;
                default:
                    decor->unk_768 = 0;
                    if (arg3 == 0) {
                        decor->unk_767--;
                    }
                    break;
            }
            break;
        case 1:
           switch (decor->unk_767) {
                case 1:
                case 2:
                case 5:
                case 6:
                    decor->unk_768 = -1;
                    break;
                case 3:
                case 4:
                case 7:
                case 8:
                    decor->unk_768 = 0;
                    break;
                case 0:
                    decor->unk_766 = 3;
                    break;
            }
            if (arg3 == 0) {
                decor->unk_767--;
            }
            break;
        case 2:
           switch (decor->unk_767) {
                case 1:
                case 2:
                case 5:
                case 6:
                case 9:
                case 10:
                case 13:
                case 14:
                    decor->unk_768 = 0;
                    break;
                case 3:
                case 4:
                case 7:
                case 8:
                case 11:
                case 12:
                    decor->unk_768 = -1;
                    break;
                case 0:
                    decor->unk_766 = 3;
                    break;
            }
            if (arg3 == 0) {
                decor->unk_767--;
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel spr_load_npc_sprite
/* 1011DC 802DE0EC 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 1011E0 802DE0F0 AFB50024 */  sw        $s5, 0x24($sp)
/* 1011E4 802DE0F4 00A0A82D */  daddu     $s5, $a1, $zero
/* 1011E8 802DE0F8 00041403 */  sra       $v0, $a0, 16
/* 1011EC 802DE0FC AFB40020 */  sw        $s4, 0x20($sp)
/* 1011F0 802DE100 30547FFF */  andi      $s4, $v0, 0x7FFF
/* 1011F4 802DE104 000437C2 */  srl       $a2, $a0, 31
/* 1011F8 802DE108 0000202D */  daddu     $a0, $zero, $zero
/* 1011FC 802DE10C AFB3001C */  sw        $s3, 0x1C($sp)
/* 101200 802DE110 3C13802E */  lui       $s3, %hi(SpriteInstances)
/* 101204 802DE114 2673FA48 */  addiu     $s3, $s3, %lo(SpriteInstances)
/* 101208 802DE118 0260182D */  daddu     $v1, $s3, $zero
/* 10120C 802DE11C AFBF0028 */  sw        $ra, 0x28($sp)
/* 101210 802DE120 AFB20018 */  sw        $s2, 0x18($sp)
/* 101214 802DE124 AFB10014 */  sw        $s1, 0x14($sp)
/* 101218 802DE128 AFB00010 */  sw        $s0, 0x10($sp)
.L802DE12C:
/* 10121C 802DE12C 8C620000 */  lw        $v0, 0x0($v1)
/* 101220 802DE130 10400005 */  beqz      $v0, .L802DE148
/* 101224 802DE134 00000000 */   nop
/* 101228 802DE138 24840001 */  addiu     $a0, $a0, 0x1
/* 10122C 802DE13C 28820033 */  slti      $v0, $a0, 0x33
/* 101230 802DE140 1440FFFA */  bnez      $v0, .L802DE12C
/* 101234 802DE144 24630014 */   addiu    $v1, $v1, 0x14
.L802DE148:
/* 101238 802DE148 3C03802E */  lui       $v1, %hi(MaxLoadedSpriteInstanceID)
/* 10123C 802DE14C 2463F530 */  addiu     $v1, $v1, %lo(MaxLoadedSpriteInstanceID)
/* 101240 802DE150 8C620000 */  lw        $v0, 0x0($v1)
/* 101244 802DE154 0044102A */  slt       $v0, $v0, $a0
/* 101248 802DE158 54400001 */  bnel      $v0, $zero, .L802DE160
/* 10124C 802DE15C AC640000 */   sw       $a0, 0x0($v1)
.L802DE160:
/* 101250 802DE160 24020033 */  addiu     $v0, $zero, 0x33
/* 101254 802DE164 14820003 */  bne       $a0, $v0, .L802DE174
/* 101258 802DE168 00141880 */   sll      $v1, $s4, 2
/* 10125C 802DE16C 080B78A2 */  j         .L802DE288
/* 101260 802DE170 2402FFFF */   addiu    $v0, $zero, -0x1
.L802DE174:
/* 101264 802DE174 3C02802E */  lui       $v0, %hi(NpcSpriteData)
/* 101268 802DE178 2442F5B0 */  addiu     $v0, $v0, %lo(NpcSpriteData)
/* 10126C 802DE17C 00628821 */  addu      $s1, $v1, $v0
/* 101270 802DE180 8E220000 */  lw        $v0, 0x0($s1)
/* 101274 802DE184 1040000E */  beqz      $v0, .L802DE1C0
/* 101278 802DE188 0080902D */   daddu    $s2, $a0, $zero
/* 10127C 802DE18C 3C03802E */  lui       $v1, %hi(NpcSpriteInstanceCount)
/* 101280 802DE190 2463F958 */  addiu     $v1, $v1, %lo(NpcSpriteInstanceCount)
/* 101284 802DE194 02831821 */  addu      $v1, $s4, $v1
/* 101288 802DE198 90620000 */  lbu       $v0, 0x0($v1)
/* 10128C 802DE19C 24420001 */  addiu     $v0, $v0, 0x1
/* 101290 802DE1A0 A0620000 */  sb        $v0, 0x0($v1)
/* 101294 802DE1A4 00121080 */  sll       $v0, $s2, 2
/* 101298 802DE1A8 00521021 */  addu      $v0, $v0, $s2
/* 10129C 802DE1AC 00021080 */  sll       $v0, $v0, 2
/* 1012A0 802DE1B0 8E300000 */  lw        $s0, 0x0($s1)
/* 1012A4 802DE1B4 00531021 */  addu      $v0, $v0, $s3
/* 1012A8 802DE1B8 080B7882 */  j         .L802DE208
/* 1012AC 802DE1BC AC500008 */   sw       $s0, 0x8($v0)
.L802DE1C0:
/* 1012B0 802DE1C0 2684FFFF */  addiu     $a0, $s4, -0x1
/* 1012B4 802DE1C4 24020001 */  addiu     $v0, $zero, 0x1
/* 1012B8 802DE1C8 3C01802E */  lui       $at, %hi(NpcSpriteInstanceCount)
/* 1012BC 802DE1CC 00340821 */  addu      $at, $at, $s4
/* 1012C0 802DE1D0 A022F958 */  sb        $v0, %lo(NpcSpriteInstanceCount)($at)
/* 1012C4 802DE1D4 0C0B7AC3 */  jal       spr_load_sprite
/* 1012C8 802DE1D8 0000282D */   daddu    $a1, $zero, $zero
/* 1012CC 802DE1DC 0040802D */  daddu     $s0, $v0, $zero
/* 1012D0 802DE1E0 00121080 */  sll       $v0, $s2, 2
/* 1012D4 802DE1E4 00521021 */  addu      $v0, $v0, $s2
/* 1012D8 802DE1E8 00021080 */  sll       $v0, $v0, 2
/* 1012DC 802DE1EC 00531021 */  addu      $v0, $v0, $s3
/* 1012E0 802DE1F0 AC500008 */  sw        $s0, 0x8($v0)
/* 1012E4 802DE1F4 12A00004 */  beqz      $s5, .L802DE208
/* 1012E8 802DE1F8 AE300000 */   sw       $s0, 0x0($s1)
/* 1012EC 802DE1FC 0200202D */  daddu     $a0, $s0, $zero
/* 1012F0 802DE200 0C0B7C03 */  jal       spr_load_npc_extra_anims
/* 1012F4 802DE204 02A0282D */   daddu    $a1, $s5, $zero
.L802DE208:
/* 1012F8 802DE208 8E040008 */  lw        $a0, 0x8($s0)
/* 1012FC 802DE20C 0C0B7CB6 */  jal       spr_allocate_components
/* 101300 802DE210 00000000 */   nop
/* 101304 802DE214 0040882D */  daddu     $s1, $v0, $zero
/* 101308 802DE218 00121080 */  sll       $v0, $s2, 2
/* 10130C 802DE21C 00521021 */  addu      $v0, $v0, $s2
/* 101310 802DE220 00021080 */  sll       $v0, $v0, 2
/* 101314 802DE224 3C01802E */  lui       $at, %hi(D_802DFA4C)
/* 101318 802DE228 00220821 */  addu      $at, $at, $v0
/* 10131C 802DE22C AC31FA4C */  sw        $s1, %lo(D_802DFA4C)($at)
/* 101320 802DE230 8E230000 */  lw        $v1, 0x0($s1)
/* 101324 802DE234 2402FFFF */  addiu     $v0, $zero, -0x1
/* 101328 802DE238 10620009 */  beq       $v1, $v0, .L802DE260
/* 10132C 802DE23C 0040982D */   daddu    $s3, $v0, $zero
.L802DE240:
/* 101330 802DE240 8E300000 */  lw        $s0, 0x0($s1)
/* 101334 802DE244 0C04E9C1 */  jal       imgfx_get_free_instances
/* 101338 802DE248 24040001 */   addiu    $a0, $zero, 0x1
/* 10133C 802DE24C 26310004 */  addiu     $s1, $s1, 0x4
/* 101340 802DE250 AE02004C */  sw        $v0, 0x4C($s0)
/* 101344 802DE254 8E220000 */  lw        $v0, 0x0($s1)
/* 101348 802DE258 1453FFF9 */  bne       $v0, $s3, .L802DE240
/* 10134C 802DE25C 00000000 */   nop
.L802DE260:
/* 101350 802DE260 0240102D */  daddu     $v0, $s2, $zero
/* 101354 802DE264 3C03802E */  lui       $v1, %hi(SpriteInstances)
/* 101358 802DE268 2463FA48 */  addiu     $v1, $v1, %lo(SpriteInstances)
/* 10135C 802DE26C 00022080 */  sll       $a0, $v0, 2
/* 101360 802DE270 00822021 */  addu      $a0, $a0, $v0
/* 101364 802DE274 00042080 */  sll       $a0, $a0, 2
/* 101368 802DE278 00832021 */  addu      $a0, $a0, $v1
/* 10136C 802DE27C 2403FFFF */  addiu     $v1, $zero, -0x1
/* 101370 802DE280 AC940000 */  sw        $s4, 0x0($a0)
/* 101374 802DE284 AC83000C */  sw        $v1, 0xC($a0)
.L802DE288:
/* 101378 802DE288 8FBF0028 */  lw        $ra, 0x28($sp)
/* 10137C 802DE28C 8FB50024 */  lw        $s5, 0x24($sp)
/* 101380 802DE290 8FB40020 */  lw        $s4, 0x20($sp)
/* 101384 802DE294 8FB3001C */  lw        $s3, 0x1C($sp)
/* 101388 802DE298 8FB20018 */  lw        $s2, 0x18($sp)
/* 10138C 802DE29C 8FB10014 */  lw        $s1, 0x14($sp)
/* 101390 802DE2A0 8FB00010 */  lw        $s0, 0x10($sp)
/* 101394 802DE2A4 03E00008 */  jr        $ra
/* 101398 802DE2A8 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

s32 spr_load_npc_sprite(s32 animID, u32* extraAnimList) {
    SpriteAnimData* header;
    SpriteComponent** compList;
    s32 listIndex;
    s32 i;

    s32 spriteIndex = (animID >> 0x10) & 0x7FFF;
    s32 useTailAlloc = (u32)animID >> 0x1F;

    for (i = 0; i < ARRAY_COUNT(SpriteInstances); i++) {
        if (SpriteInstances[i].spriteIndex == 0) {
            break;
        }
    }
    if (MaxLoadedSpriteInstanceID < i) {
        MaxLoadedSpriteInstanceID = i;
    }
    if (i == ARRAY_COUNT(SpriteInstances)) {
        return -1;
    }
    listIndex = i;
    if (NpcSpriteData[spriteIndex] != NULL) {
        NpcSpriteInstanceCount[spriteIndex]++;
        header = NpcSpriteData[spriteIndex];
        SpriteInstances[listIndex].spriteData = header;
    } else {
        NpcSpriteInstanceCount[spriteIndex] = 1;
        header = spr_load_sprite(spriteIndex - 1, FALSE, useTailAlloc);
        SpriteInstances[listIndex].spriteData = header;
        NpcSpriteData[spriteIndex] = header;
        if (extraAnimList != NULL) {
            spr_load_npc_extra_anims(header, extraAnimList);
        }
    }
    compList = spr_allocate_components(header->maxComponents);
    SpriteInstances[listIndex].componentList = compList;
    while (*compList != PTR_LIST_END) {
        SpriteComponent* comp = *compList;
        comp->imgfxIdx = imgfx_get_free_instances(1);
        compList++;
    }
    SpriteInstances[listIndex].spriteIndex = spriteIndex;
    SpriteInstances[listIndex].currentAnimID = -1;
    return listIndex;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_raycast_up
/* 76320 800DCE70 27BDFF50 */  addiu     $sp, $sp, -0xB0
/* 76324 800DCE74 AFB20078 */  sw        $s2, 0x78($sp)
/* 76328 800DCE78 8FB200C0 */  lw        $s2, 0xC0($sp)
/* 7632C 800DCE7C F7BA00A8 */  sdc1      $f26, 0xA8($sp)
/* 76330 800DCE80 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 76334 800DCE84 4481D000 */  mtc1      $at, $f26
/* 76338 800DCE88 AFB00070 */  sw        $s0, 0x70($sp)
/* 7633C 800DCE8C 0080802D */  daddu     $s0, $a0, $zero
/* 76340 800DCE90 AFB3007C */  sw        $s3, 0x7C($sp)
/* 76344 800DCE94 00A0982D */  daddu     $s3, $a1, $zero
/* 76348 800DCE98 AFB40080 */  sw        $s4, 0x80($sp)
/* 7634C 800DCE9C 00C0A02D */  daddu     $s4, $a2, $zero
/* 76350 800DCEA0 AFB50084 */  sw        $s5, 0x84($sp)
/* 76354 800DCEA4 00E0A82D */  daddu     $s5, $a3, $zero
/* 76358 800DCEA8 AFBF0088 */  sw        $ra, 0x88($sp)
/* 7635C 800DCEAC AFB10074 */  sw        $s1, 0x74($sp)
/* 76360 800DCEB0 F7B800A0 */  sdc1      $f24, 0xA0($sp)
/* 76364 800DCEB4 F7B60098 */  sdc1      $f22, 0x98($sp)
/* 76368 800DCEB8 F7B40090 */  sdc1      $f20, 0x90($sp)
/* 7636C 800DCEBC C6400000 */  lwc1      $f0, 0x0($s2)
/* 76370 800DCEC0 27A20038 */  addiu     $v0, $sp, 0x38
/* 76374 800DCEC4 E7A00044 */  swc1      $f0, 0x44($sp)
/* 76378 800DCEC8 E7A00060 */  swc1      $f0, 0x60($sp)
/* 7637C 800DCECC C6760000 */  lwc1      $f22, 0x0($s3)
/* 76380 800DCED0 C6980000 */  lwc1      $f24, 0x0($s4)
/* 76384 800DCED4 C6B40000 */  lwc1      $f20, 0x0($s5)
/* 76388 800DCED8 AFA2001C */  sw        $v0, 0x1C($sp)
/* 7638C 800DCEDC 27A2003C */  addiu     $v0, $sp, 0x3C
/* 76390 800DCEE0 AFA20020 */  sw        $v0, 0x20($sp)
/* 76394 800DCEE4 27A20040 */  addiu     $v0, $sp, 0x40
/* 76398 800DCEE8 AFA20024 */  sw        $v0, 0x24($sp)
/* 7639C 800DCEEC 27A20044 */  addiu     $v0, $sp, 0x44
/* 763A0 800DCEF0 AFA20028 */  sw        $v0, 0x28($sp)
/* 763A4 800DCEF4 27A20048 */  addiu     $v0, $sp, 0x48
/* 763A8 800DCEF8 AFA2002C */  sw        $v0, 0x2C($sp)
/* 763AC 800DCEFC 27A2004C */  addiu     $v0, $sp, 0x4C
/* 763B0 800DCF00 AFA20030 */  sw        $v0, 0x30($sp)
/* 763B4 800DCF04 4406C000 */  mfc1      $a2, $f24
/* 763B8 800DCF08 4407A000 */  mfc1      $a3, $f20
/* 763BC 800DCF0C 4405B000 */  mfc1      $a1, $f22
/* 763C0 800DCF10 27A20050 */  addiu     $v0, $sp, 0x50
/* 763C4 800DCF14 AFA00010 */  sw        $zero, 0x10($sp)
/* 763C8 800DCF18 E7BA0014 */  swc1      $f26, 0x14($sp)
/* 763CC 800DCF1C AFA00018 */  sw        $zero, 0x18($sp)
/* 763D0 800DCF20 0C017334 */  jal       test_ray_colliders
/* 763D4 800DCF24 AFA20034 */   sw       $v0, 0x34($sp)
/* 763D8 800DCF28 0040882D */  daddu     $s1, $v0, $zero
/* 763DC 800DCF2C 3C020004 */  lui       $v0, (0x40000 >> 16)
/* 763E0 800DCF30 02028024 */  and       $s0, $s0, $v0
/* 763E4 800DCF34 16000029 */  bnez      $s0, .L800DCFDC
/* 763E8 800DCF38 0220182D */   daddu    $v1, $s1, $zero
/* 763EC 800DCF3C 27A20054 */  addiu     $v0, $sp, 0x54
/* 763F0 800DCF40 AFA20018 */  sw        $v0, 0x18($sp)
/* 763F4 800DCF44 27A20058 */  addiu     $v0, $sp, 0x58
/* 763F8 800DCF48 AFA2001C */  sw        $v0, 0x1C($sp)
/* 763FC 800DCF4C 27A2005C */  addiu     $v0, $sp, 0x5C
/* 76400 800DCF50 AFA20020 */  sw        $v0, 0x20($sp)
/* 76404 800DCF54 27A20060 */  addiu     $v0, $sp, 0x60
/* 76408 800DCF58 AFA20024 */  sw        $v0, 0x24($sp)
/* 7640C 800DCF5C 27A20064 */  addiu     $v0, $sp, 0x64
/* 76410 800DCF60 AFA20028 */  sw        $v0, 0x28($sp)
/* 76414 800DCF64 27A20068 */  addiu     $v0, $sp, 0x68
/* 76418 800DCF68 AFA2002C */  sw        $v0, 0x2C($sp)
/* 7641C 800DCF6C 27A2006C */  addiu     $v0, $sp, 0x6C
/* 76420 800DCF70 4600B306 */  mov.s     $f12, $f22
/* 76424 800DCF74 44800000 */  mtc1      $zero, $f0
/* 76428 800DCF78 4406A000 */  mfc1      $a2, $f20
/* 7642C 800DCF7C 44070000 */  mfc1      $a3, $f0
/* 76430 800DCF80 4600C386 */  mov.s     $f14, $f24
/* 76434 800DCF84 E7BA0010 */  swc1      $f26, 0x10($sp)
/* 76438 800DCF88 AFA20030 */  sw        $v0, 0x30($sp)
/* 7643C 800DCF8C 0C017512 */  jal       test_ray_entities
/* 76440 800DCF90 AFA70014 */   sw       $a3, 0x14($sp)
/* 76444 800DCF94 04400010 */  bltz      $v0, .L800DCFD8
/* 76448 800DCF98 34434000 */   ori      $v1, $v0, 0x4000
/* 7644C 800DCF9C C7A00060 */  lwc1      $f0, 0x60($sp)
/* 76450 800DCFA0 C7A20054 */  lwc1      $f2, 0x54($sp)
/* 76454 800DCFA4 C7A40058 */  lwc1      $f4, 0x58($sp)
/* 76458 800DCFA8 C7A6005C */  lwc1      $f6, 0x5C($sp)
/* 7645C 800DCFAC C7A80064 */  lwc1      $f8, 0x64($sp)
/* 76460 800DCFB0 C7AA0068 */  lwc1      $f10, 0x68($sp)
/* 76464 800DCFB4 C7AC006C */  lwc1      $f12, 0x6C($sp)
/* 76468 800DCFB8 E7A00044 */  swc1      $f0, 0x44($sp)
/* 7646C 800DCFBC E7A20038 */  swc1      $f2, 0x38($sp)
/* 76470 800DCFC0 E7A4003C */  swc1      $f4, 0x3C($sp)
/* 76474 800DCFC4 E7A60040 */  swc1      $f6, 0x40($sp)
/* 76478 800DCFC8 E7A80048 */  swc1      $f8, 0x48($sp)
/* 7647C 800DCFCC E7AA004C */  swc1      $f10, 0x4C($sp)
/* 76480 800DCFD0 080373F7 */  j         .L800DCFDC
/* 76484 800DCFD4 E7AC0050 */   swc1     $f12, 0x50($sp)
.L800DCFD8:
/* 76488 800DCFD8 0220182D */  daddu     $v1, $s1, $zero
.L800DCFDC:
/* 7648C 800DCFDC 0460000D */  bltz      $v1, .L800DD014
/* 76490 800DCFE0 24020001 */   addiu    $v0, $zero, 0x1
/* 76494 800DCFE4 C7A00044 */  lwc1      $f0, 0x44($sp)
/* 76498 800DCFE8 E6400000 */  swc1      $f0, 0x0($s2)
/* 7649C 800DCFEC C7A00038 */  lwc1      $f0, 0x38($sp)
/* 764A0 800DCFF0 E6600000 */  swc1      $f0, 0x0($s3)
/* 764A4 800DCFF4 C7A0003C */  lwc1      $f0, 0x3C($sp)
/* 764A8 800DCFF8 E6800000 */  swc1      $f0, 0x0($s4)
/* 764AC 800DCFFC C7A00040 */  lwc1      $f0, 0x40($sp)
/* 764B0 800DD000 E6A00000 */  swc1      $f0, 0x0($s5)
/* 764B4 800DD004 3C018011 */  lui       $at, %hi(NpcHitQueryColliderID)
/* 764B8 800DD008 AC23C978 */  sw        $v1, %lo(NpcHitQueryColliderID)($at)
/* 764BC 800DD00C 08037406 */  j         .L800DD018
/* 764C0 800DD010 00000000 */   nop
.L800DD014:
/* 764C4 800DD014 0000102D */  daddu     $v0, $zero, $zero
.L800DD018:
/* 764C8 800DD018 8FBF0088 */  lw        $ra, 0x88($sp)
/* 764CC 800DD01C 8FB50084 */  lw        $s5, 0x84($sp)
/* 764D0 800DD020 8FB40080 */  lw        $s4, 0x80($sp)
/* 764D4 800DD024 8FB3007C */  lw        $s3, 0x7C($sp)
/* 764D8 800DD028 8FB20078 */  lw        $s2, 0x78($sp)
/* 764DC 800DD02C 8FB10074 */  lw        $s1, 0x74($sp)
/* 764E0 800DD030 8FB00070 */  lw        $s0, 0x70($sp)
/* 764E4 800DD034 D7BA00A8 */  ldc1      $f26, 0xA8($sp)
/* 764E8 800DD038 D7B800A0 */  ldc1      $f24, 0xA0($sp)
/* 764EC 800DD03C D7B60098 */  ldc1      $f22, 0x98($sp)
/* 764F0 800DD040 D7B40090 */  ldc1      $f20, 0x90($sp)
/* 764F4 800DD044 03E00008 */  jr        $ra
/* 764F8 800DD048 27BD00B0 */   addiu    $sp, $sp, 0xB0

### DECOMPILED C INSTRUCTIONS:

s32 npc_raycast_up(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* hitDepth) {
    f32 cHitX;
    f32 cHitY;
    f32 cHitZ;
    f32 cHitDepth;
    f32 cHitNx;
    f32 cHitNy;
    f32 cHitNz;
    f32 eHitX;
    f32 eHitY;
    f32 eHitZ;
    f32 eHitDepth;
    f32 eHitNx;
    f32 eHitNy;
    f32 eHitNz;
    s32 entityID;
    s32 colliderID;
    f32 sx, sy, sz;
    s32 ret;

    eHitDepth = cHitDepth = *hitDepth;
    sx = *startX;
    sy = *startY;
    sz = *startZ;
    ret = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, 1.0f, 0.0f, &cHitX, &cHitY, &cHitZ, &cHitDepth, &cHitNx, &cHitNy, &cHitNz);
    colliderID = ret;
    if ((ignoreFlags & COLLISION_IGNORE_ENTITIES) == 0)  {
        entityID = test_ray_entities(sx, sy, sz, 0.0f, 1.0f, 0.0f, &eHitX, &eHitY, &eHitZ, &eHitDepth, &eHitNx, &eHitNy, &eHitNz);
        ret = entityID | COLLISION_WITH_ENTITY_BIT;
        if (entityID >= 0) {
            cHitDepth = eHitDepth;
            cHitX = eHitX;
            cHitY = eHitY;
            cHitZ = eHitZ;
            cHitNx = eHitNx;
            cHitNy = eHitNy;
            cHitNz = eHitNz;
        } else {
            ret = colliderID;
        }
    }

    if (ret < 0) {
        // TODO find better match
        colliderID = 0;
        return colliderID;
    } else {
        *hitDepth = cHitDepth;
        *startX = cHitX;
        *startY = cHitY;
        *startZ = cHitZ;
        NpcHitQueryColliderID = ret;
        return TRUE;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_entity_model_B
/* B85B8 80121EB8 27BDFF60 */  addiu     $sp, $sp, -0xA0
/* B85BC 80121EBC 0080402D */  daddu     $t0, $a0, $zero
/* B85C0 80121EC0 AFB1008C */  sw        $s1, 0x8C($sp)
/* B85C4 80121EC4 27B10028 */  addiu     $s1, $sp, 0x28
/* B85C8 80121EC8 3C09800A */  lui       $t1, %hi(gCurrentCamID)
/* B85CC 80121ECC 8529A634 */  lh        $t1, %lo(gCurrentCamID)($t1)
/* B85D0 80121ED0 3C04800B */  lui       $a0, %hi(gCameras)
/* B85D4 80121ED4 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* B85D8 80121ED8 AFBF0094 */  sw        $ra, 0x94($sp)
/* B85DC 80121EDC AFB20090 */  sw        $s2, 0x90($sp)
/* B85E0 80121EE0 AFB00088 */  sw        $s0, 0x88($sp)
/* B85E4 80121EE4 F7B40098 */  sdc1      $f20, 0x98($sp)
/* B85E8 80121EE8 00091080 */  sll       $v0, $t1, 2
/* B85EC 80121EEC 00491021 */  addu      $v0, $v0, $t1
/* B85F0 80121EF0 00021080 */  sll       $v0, $v0, 2
/* B85F4 80121EF4 00491023 */  subu      $v0, $v0, $t1
/* B85F8 80121EF8 000218C0 */  sll       $v1, $v0, 3
/* B85FC 80121EFC 00431021 */  addu      $v0, $v0, $v1
/* B8600 80121F00 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* B8604 80121F04 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* B8608 80121F08 000210C0 */  sll       $v0, $v0, 3
/* B860C 80121F0C 80630070 */  lb        $v1, 0x70($v1)
/* B8610 80121F10 10600004 */  beqz      $v1, .L80121F24
/* B8614 80121F14 00449021 */   addu     $s2, $v0, $a0
/* B8618 80121F18 31020800 */  andi      $v0, $t0, 0x800
/* B861C 80121F1C 10400053 */  beqz      $v0, .L8012206C
/* B8620 80121F20 00000000 */   nop
.L80121F24:
/* B8624 80121F24 2402F7FF */  addiu     $v0, $zero, -0x801
/* B8628 80121F28 01024024 */  and       $t0, $t0, $v0
/* B862C 80121F2C 3C038015 */  lui       $v1, %hi(gCurrentEntityModelList)
/* B8630 80121F30 8C634370 */  lw        $v1, %lo(gCurrentEntityModelList)($v1)
/* B8634 80121F34 00081080 */  sll       $v0, $t0, 2
/* B8638 80121F38 00431021 */  addu      $v0, $v0, $v1
/* B863C 80121F3C 8C500000 */  lw        $s0, 0x0($v0)
/* B8640 80121F40 1200004A */  beqz      $s0, .L8012206C
/* B8644 80121F44 00000000 */   nop
/* B8648 80121F48 8E030000 */  lw        $v1, 0x0($s0)
/* B864C 80121F4C 10600047 */  beqz      $v1, .L8012206C
/* B8650 80121F50 30620100 */   andi     $v0, $v1, 0x100
/* B8654 80121F54 14400045 */  bnez      $v0, .L8012206C
/* B8658 80121F58 30620020 */   andi     $v0, $v1, 0x20
/* B865C 80121F5C 14400043 */  bnez      $v0, .L8012206C
/* B8660 80121F60 24020001 */   addiu    $v0, $zero, 0x1
/* B8664 80121F64 01221004 */  sllv      $v0, $v0, $t1
/* B8668 80121F68 00621024 */  and       $v0, $v1, $v0
/* B866C 80121F6C 1040003F */  beqz      $v0, .L8012206C
/* B8670 80121F70 26030018 */   addiu    $v1, $s0, 0x18
/* B8674 80121F74 00A0102D */  daddu     $v0, $a1, $zero
/* B8678 80121F78 24A40040 */  addiu     $a0, $a1, 0x40
.L80121F7C:
/* B867C 80121F7C 8C4A0000 */  lw        $t2, 0x0($v0)
/* B8680 80121F80 8C4B0004 */  lw        $t3, 0x4($v0)
/* B8684 80121F84 8C4C0008 */  lw        $t4, 0x8($v0)
/* B8688 80121F88 8C4D000C */  lw        $t5, 0xC($v0)
/* B868C 80121F8C AC6A0000 */  sw        $t2, 0x0($v1)
/* B8690 80121F90 AC6B0004 */  sw        $t3, 0x4($v1)
/* B8694 80121F94 AC6C0008 */  sw        $t4, 0x8($v1)
/* B8698 80121F98 AC6D000C */  sw        $t5, 0xC($v1)
/* B869C 80121F9C 24420010 */  addiu     $v0, $v0, 0x10
/* B86A0 80121FA0 1444FFF6 */  bne       $v0, $a0, .L80121F7C
/* B86A4 80121FA4 24630010 */   addiu    $v1, $v1, 0x10
/* B86A8 80121FA8 27A40038 */  addiu     $a0, $sp, 0x38
/* B86AC 80121FAC 3C018015 */  lui       $at, %hi(D_80154374)
/* B86B0 80121FB0 AC264374 */  sw        $a2, %lo(D_80154374)($at)
/* B86B4 80121FB4 0C019D60 */  jal       guMtxL2F
/* B86B8 80121FB8 AE07005C */   sw       $a3, 0x5C($s0)
/* B86BC 80121FBC 264400D4 */  addiu     $a0, $s2, 0xD4
/* B86C0 80121FC0 C7A00068 */  lwc1      $f0, 0x68($sp)
/* B86C4 80121FC4 C7A2006C */  lwc1      $f2, 0x6C($sp)
/* B86C8 80121FC8 C7B40070 */  lwc1      $f20, 0x70($sp)
/* B86CC 80121FCC 27A20078 */  addiu     $v0, $sp, 0x78
/* B86D0 80121FD0 AFA20014 */  sw        $v0, 0x14($sp)
/* B86D4 80121FD4 27A2007C */  addiu     $v0, $sp, 0x7C
/* B86D8 80121FD8 AFA20018 */  sw        $v0, 0x18($sp)
/* B86DC 80121FDC 27A20080 */  addiu     $v0, $sp, 0x80
/* B86E0 80121FE0 AFA2001C */  sw        $v0, 0x1C($sp)
/* B86E4 80121FE4 44050000 */  mfc1      $a1, $f0
/* B86E8 80121FE8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* B86EC 80121FEC 44810000 */  mtc1      $at, $f0
/* B86F0 80121FF0 44061000 */  mfc1      $a2, $f2
/* B86F4 80121FF4 4407A000 */  mfc1      $a3, $f20
/* B86F8 80121FF8 27A20084 */  addiu     $v0, $sp, 0x84
/* B86FC 80121FFC AFA20020 */  sw        $v0, 0x20($sp)
/* B8700 80122000 0C00A588 */  jal       transform_point
/* B8704 80122004 E7A00010 */   swc1     $f0, 0x10($sp)
/* B8708 80122008 82030004 */  lb        $v1, 0x4($s0)
/* B870C 8012200C 3C028012 */  lui       $v0, %hi(appendGfx_entity_model)
/* B8710 80122010 24421184 */  addiu     $v0, $v0, %lo(appendGfx_entity_model)
/* B8714 80122014 AE300008 */  sw        $s0, 0x8($s1)
/* B8718 80122018 AE22000C */  sw        $v0, 0xC($s1)
/* B871C 8012201C AE230000 */  sw        $v1, 0x0($s1)
/* B8720 80122020 8E020000 */  lw        $v0, 0x0($s0)
/* B8724 80122024 3042F000 */  andi      $v0, $v0, 0xF000
/* B8728 80122028 00021202 */  srl       $v0, $v0, 8
/* B872C 8012202C 44821000 */  mtc1      $v0, $f2
/* B8730 80122030 00000000 */  nop
/* B8734 80122034 468010A1 */  cvt.d.w   $f2, $f2
/* B8738 80122038 04430007 */  bgezl     $v0, .L80122058
/* B873C 8012203C 46201020 */   cvt.s.d  $f0, $f2
/* B8740 80122040 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* B8744 80122044 44810800 */  mtc1      $at, $f1
/* B8748 80122048 44800000 */  mtc1      $zero, $f0
/* B874C 8012204C 00000000 */  nop
/* B8750 80122050 46201080 */  add.d     $f2, $f2, $f0
/* B8754 80122054 46201020 */  cvt.s.d   $f0, $f2
.L80122058:
/* B8758 80122058 46140000 */  add.s     $f0, $f0, $f20
/* B875C 8012205C 0220202D */  daddu     $a0, $s1, $zero
/* B8760 80122060 4600010D */  trunc.w.s $f4, $f0
/* B8764 80122064 0C047644 */  jal       queue_render_task
/* B8768 80122068 E4840004 */   swc1     $f4, 0x4($a0)
.L8012206C:
/* B876C 8012206C 8FBF0094 */  lw        $ra, 0x94($sp)
/* B8770 80122070 8FB20090 */  lw        $s2, 0x90($sp)
/* B8774 80122074 8FB1008C */  lw        $s1, 0x8C($sp)
/* B8778 80122078 8FB00088 */  lw        $s0, 0x88($sp)
/* B877C 8012207C D7B40098 */  ldc1      $f20, 0x98($sp)
/* B8780 80122080 03E00008 */  jr        $ra
/* B8784 80122084 27BD00A0 */   addiu    $sp, $sp, 0xA0

### DECOMPILED C INSTRUCTIONS:

void draw_entity_model_B(s32 modelIdx, Mtx* transformMtx, s32 vertexSegment, Vec3s* vertexArray) {
    EntityModel* model;
    RenderTask rt;
    RenderTask* rtPtr = &rt;
    Camera* camera = &gCameras[gCurrentCamID];
    Matrix4f mtx;
    f32 x, y, z, w;
    f32 inX, inY, inZ;

    if ((gGameStatusPtr->isBattle == 0) || (modelIdx & 0x800)) {
        modelIdx &= ~0x800;
        model = (*gCurrentEntityModelList)[modelIdx];

        if (model != NULL) {
            if (model->flags != 0) {
                if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
                    if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
                        if (model->flags & (1 << gCurrentCamID)) {
                            model->transform = *transformMtx;
                            D_80154374 = vertexSegment;
                            model->vertexArray = vertexArray;
                            guMtxL2F(mtx, transformMtx);
                            inX = mtx[3][0];
                            inY = mtx[3][1];
                            inZ = mtx[3][2];
                            transform_point(camera->perspectiveMatrix, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
                            rtPtr->renderMode = model->renderMode;
                            rtPtr->appendGfxArg = model;
                            rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
                            rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ;
                            queue_render_task(rtPtr);
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8024C7A4
/* 13FAE4 8024C7A4 3C028027 */  lui       $v0, %hi(gPausePartnersCurrentPartnerIdx)
/* 13FAE8 8024C7A8 8C4206A0 */  lw        $v0, %lo(gPausePartnersCurrentPartnerIdx)($v0)
/* 13FAEC 8024C7AC 00021840 */  sll       $v1, $v0, 1
/* 13FAF0 8024C7B0 00621821 */  addu      $v1, $v1, $v0
/* 13FAF4 8024C7B4 00031100 */  sll       $v0, $v1, 4
/* 13FAF8 8024C7B8 00431023 */  subu      $v0, $v0, $v1
/* 13FAFC 8024C7BC 3C038027 */  lui       $v1, %hi(gPausePartnersNumPartners)
/* 13FB00 8024C7C0 8C6306B0 */  lw        $v1, %lo(gPausePartnersNumPartners)($v1)
/* 13FB04 8024C7C4 000210C0 */  sll       $v0, $v0, 3
/* 13FB08 8024C7C8 14600002 */  bnez      $v1, .L8024C7D4
/* 13FB0C 8024C7CC 0043001A */   div      $zero, $v0, $v1
D_8024C7D0_C0A050:
/* 13FB10 8024C7D0 0007000D */  break     7
.L8024C7D4:
/* 13FB14 8024C7D4 2401FFFF */  addiu     $at, $zero, -0x1
/* 13FB18 8024C7D8 14610004 */  bne       $v1, $at, .L8024C7EC
/* 13FB1C 8024C7DC 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 13FB20 8024C7E0 14410002 */  bne       $v0, $at, .L8024C7EC
/* 13FB24 8024C7E4 00000000 */   nop
/* 13FB28 8024C7E8 0006000D */  break     6
.L8024C7EC:
/* 13FB2C 8024C7EC 00001012 */  mflo      $v0
/* 13FB30 8024C7F0 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 13FB34 8024C7F4 AFB10014 */  sw        $s1, 0x14($sp)
/* 13FB38 8024C7F8 3C118027 */  lui       $s1, %hi(gPausePartnersRotAngle)
/* 13FB3C 8024C7FC 263106A8 */  addiu     $s1, $s1, %lo(gPausePartnersRotAngle)
/* 13FB40 8024C800 AFBF0020 */  sw        $ra, 0x20($sp)
/* 13FB44 8024C804 AFB3001C */  sw        $s3, 0x1C($sp)
D_8024C808_C0A088:
/* 13FB48 8024C808 AFB20018 */  sw        $s2, 0x18($sp)
/* 13FB4C 8024C80C AFB00010 */  sw        $s0, 0x10($sp)
/* 13FB50 8024C810 F7B40028 */  sdc1      $f20, 0x28($sp)
/* 13FB54 8024C814 C6220000 */  lwc1      $f2, 0x0($s1)
/* 13FB58 8024C818 44820000 */  mtc1      $v0, $f0
/* 13FB5C 8024C81C 00000000 */  nop
/* 13FB60 8024C820 46800020 */  cvt.s.w   $f0, $f0
/* 13FB64 8024C824 46020501 */  sub.s     $f20, $f0, $f2
/* 13FB68 8024C828 4600A10D */  trunc.w.s $f4, $f20
/* 13FB6C 8024C82C 44042000 */  mfc1      $a0, $f4
/* 13FB70 8024C830 00000000 */  nop
/* 13FB74 8024C834 04810002 */  bgez      $a0, .L8024C840
/* 13FB78 8024C838 0080802D */   daddu    $s0, $a0, $zero
/* 13FB7C 8024C83C 00108023 */  negu      $s0, $s0
.L8024C840:
/* 13FB80 8024C840 0C00A52C */  jal       sign
/* 13FB84 8024C844 00000000 */   nop
/* 13FB88 8024C848 0040182D */  daddu     $v1, $v0, $zero
/* 13FB8C 8024C84C 2A020010 */  slti      $v0, $s0, 0x10
/* 13FB90 8024C850 14400008 */  bnez      $v0, .L8024C874
/* 13FB94 8024C854 00000000 */   nop
/* 13FB98 8024C858 3C018027 */  lui       $at, %hi(D_80270048)
/* 13FB9C 8024C85C D4220048 */  ldc1      $f2, %lo(D_80270048)($at)
/* 13FBA0 8024C860 4600A021 */  cvt.d.s   $f0, $f20
/* 13FBA4 8024C864 46220002 */  mul.d     $f0, $f0, $f2
/* 13FBA8 8024C868 00000000 */  nop
/* 13FBAC 8024C86C 0809322D */  j         .L8024C8B4
/* 13FBB0 8024C870 462000A0 */   cvt.s.d  $f2, $f0
.L8024C874:
/* 13FBB4 8024C874 3C028025 */  lui       $v0, %hi(D_8024F87C)
/* 13FBB8 8024C878 00501021 */  addu      $v0, $v0, $s0
/* 13FBBC 8024C87C 9042F87C */  lbu       $v0, %lo(D_8024F87C)($v0)
/* 13FBC0 8024C880 C6200000 */  lwc1      $f0, 0x0($s1)
/* 13FBC4 8024C884 00620018 */  mult      $v1, $v0
/* 13FBC8 8024C888 4600010D */  trunc.w.s $f4, $f0
/* 13FBCC 8024C88C 44022000 */  mfc1      $v0, $f4
/* 13FBD0 8024C890 00000000 */  nop
/* 13FBD4 8024C894 44820000 */  mtc1      $v0, $f0
/* 13FBD8 8024C898 00000000 */  nop
/* 13FBDC 8024C89C 46800020 */  cvt.s.w   $f0, $f0
/* 13FBE0 8024C8A0 E6200000 */  swc1      $f0, 0x0($s1)
/* 13FBE4 8024C8A4 00003812 */  mflo      $a3
/* 13FBE8 8024C8A8 44871000 */  mtc1      $a3, $f2
/* 13FBEC 8024C8AC 00000000 */  nop
/* 13FBF0 8024C8B0 468010A0 */  cvt.s.w   $f2, $f2
.L8024C8B4:
/* 13FBF4 8024C8B4 3C028027 */  lui       $v0, %hi(gPausePartnersRotAngle)
/* 13FBF8 8024C8B8 244206A8 */  addiu     $v0, $v0, %lo(gPausePartnersRotAngle)
/* 13FBFC 8024C8BC C4400000 */  lwc1      $f0, 0x0($v0)
/* 13FC00 8024C8C0 46020000 */  add.s     $f0, $f0, $f2
/* 13FC04 8024C8C4 3C038027 */  lui       $v1, %hi(gPausePartnersNumPartners)
/* 13FC08 8024C8C8 8C6306B0 */  lw        $v1, %lo(gPausePartnersNumPartners)($v1)
/* 13FC0C 8024C8CC 0000882D */  daddu     $s1, $zero, $zero
/* 13FC10 8024C8D0 18600024 */  blez      $v1, .L8024C964
D_8024C8D4:
/* 13FC14 8024C8D4 E4400000 */   swc1     $f0, 0x0($v0)
/* 13FC18 8024C8D8 3C138027 */  lui       $s3, %hi(gPausePartnersSpriteIDs)
/* 13FC1C 8024C8DC 26730660 */  addiu     $s3, $s3, %lo(gPausePartnersSpriteIDs)
D_8024C8E0_C0A160:
/* 13FC20 8024C8E0 3C128025 */  lui       $s2, %hi(D_8024F630)
/* 13FC24 8024C8E4 2652F630 */  addiu     $s2, $s2, %lo(D_8024F630)
/* 13FC28 8024C8E8 3C108027 */  lui       $s0, %hi(gPausePartnersPartnerIdx)
/* 13FC2C 8024C8EC 26100680 */  addiu     $s0, $s0, %lo(gPausePartnersPartnerIdx)
.L8024C8F0:
/* 13FC30 8024C8F0 3C028027 */  lui       $v0, %hi(gPausePartnersCurrentPartnerIdx)
/* 13FC34 8024C8F4 8C4206A0 */  lw        $v0, %lo(gPausePartnersCurrentPartnerIdx)($v0)
/* 13FC38 8024C8F8 1622000A */  bne       $s1, $v0, .L8024C924
/* 13FC3C 8024C8FC 00000000 */   nop
/* 13FC40 8024C900 8E030000 */  lw        $v1, 0x0($s0)
/* 13FC44 8024C904 3C063F80 */  lui       $a2, (0x3F800000 >> 16)
/* 13FC48 8024C908 00031080 */  sll       $v0, $v1, 2
/* 13FC4C 8024C90C 00531021 */  addu      $v0, $v0, $s3
/* 13FC50 8024C910 00031900 */  sll       $v1, $v1, 4
.L8024C914:
/* 13FC54 8024C914 00721821 */  addu      $v1, $v1, $s2
D_8024C918_C0A198:
/* 13FC58 8024C918 8C440000 */  lw        $a0, 0x0($v0)
/* 13FC5C 8024C91C 08093251 */  j         func_8024C944
/* 13FC60 8024C920 8C650004 */   lw       $a1, 0x4($v1)
.L8024C924:
/* 13FC64 8024C924 8E030000 */  lw        $v1, 0x0($s0)
/* 13FC68 8024C928 3C063F80 */  lui       $a2, (0x3F800000 >> 16)
/* 13FC6C 8024C92C 00031080 */  sll       $v0, $v1, 2
/* 13FC70 8024C930 00531021 */  addu      $v0, $v0, $s3
/* 13FC74 8024C934 00031900 */  sll       $v1, $v1, 4
/* 13FC78 8024C938 00721821 */  addu      $v1, $v1, $s2
/* 13FC7C 8024C93C 8C440000 */  lw        $a0, 0x0($v0)
/* 13FC80 8024C940 8C650000 */  lw        $a1, 0x0($v1)
glabel func_8024C944
/* 13FC84 8024C944 0C0B78AB */  jal       spr_update_sprite
/* 13FC88 8024C948 26100004 */   addiu    $s0, $s0, 0x4
/* 13FC8C 8024C94C 3C028027 */  lui       $v0, %hi(gPausePartnersNumPartners)
/* 13FC90 8024C950 8C4206B0 */  lw        $v0, %lo(gPausePartnersNumPartners)($v0)
/* 13FC94 8024C954 26310001 */  addiu     $s1, $s1, 0x1
/* 13FC98 8024C958 0222102A */  slt       $v0, $s1, $v0
/* 13FC9C 8024C95C 1440FFE4 */  bnez      $v0, .L8024C8F0
/* 13FCA0 8024C960 00000000 */   nop
.L8024C964:
/* 13FCA4 8024C964 8FBF0020 */  lw        $ra, 0x20($sp)
/* 13FCA8 8024C968 8FB3001C */  lw        $s3, 0x1C($sp)
/* 13FCAC 8024C96C 8FB20018 */  lw        $s2, 0x18($sp)
/* 13FCB0 8024C970 8FB10014 */  lw        $s1, 0x14($sp)
/* 13FCB4 8024C974 8FB00010 */  lw        $s0, 0x10($sp)
/* 13FCB8 8024C978 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 13FCBC 8024C97C 03E00008 */  jr        $ra
/* 13FCC0 8024C980 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void pause_partners_update(MenuPanel* panel) {
    s32 i;
    f32 delta;
    s32 absValue;
    f32 deltaBefore;
    s32 sgn;

    deltaBefore = gPausePartnersCurrentPartnerIdx * 360 / gPausePartnersNumPartners - gPausePartnersRotAngle;
    absValue = abs(deltaBefore);
    sgn = sign(deltaBefore);

    if (absValue >= 16) {
        delta = deltaBefore * 0.3;
    } else {
        delta = sgn * gPausePartnersPortraitScrollInterpTable[absValue];
        gPausePartnersRotAngle = (int)gPausePartnersRotAngle;
    }
    gPausePartnersRotAngle += delta;

    for (i = 0; i < gPausePartnersNumPartners; i++) {
        if (i == gPausePartnersCurrentPartnerIdx) {
            spr_update_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[i]], gPausePartnersSpriteAnims[gPausePartnersPartnerIdx[i]][1], 1.0f);
        } else {
            spr_update_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[i]], gPausePartnersSpriteAnims[gPausePartnersPartnerIdx[i]][0], 1.0f);
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_load_INIT
/* 2F6BC 800542BC 27BDFF70 */  addiu     $sp, $sp, -0x90
/* 2F6C0 800542C0 AFB3007C */  sw        $s3, 0x7C($sp)
/* 2F6C4 800542C4 0080982D */  daddu     $s3, $a0, $zero
/* 2F6C8 800542C8 AFB10074 */  sw        $s1, 0x74($sp)
/* 2F6CC 800542CC 00A0882D */  daddu     $s1, $a1, $zero
/* 2F6D0 800542D0 AFB40080 */  sw        $s4, 0x80($sp)
/* 2F6D4 800542D4 00C0A02D */  daddu     $s4, $a2, $zero
/* 2F6D8 800542D8 0220202D */  daddu     $a0, $s1, $zero
/* 2F6DC 800542DC 27A50010 */  addiu     $a1, $sp, 0x10
/* 2F6E0 800542E0 24060040 */  addiu     $a2, $zero, 0x40
/* 2F6E4 800542E4 AFB50084 */  sw        $s5, 0x84($sp)
/* 2F6E8 800542E8 2675001C */  addiu     $s5, $s3, 0x1C
/* 2F6EC 800542EC AFBF0088 */  sw        $ra, 0x88($sp)
/* 2F6F0 800542F0 AFB20078 */  sw        $s2, 0x78($sp)
/* 2F6F4 800542F4 0C015380 */  jal       au_read_rom
/* 2F6F8 800542F8 AFB00070 */   sw       $s0, 0x70($sp)
/* 2F6FC 800542FC 0280202D */  daddu     $a0, $s4, $zero
/* 2F700 80054300 8FB00024 */  lw        $s0, 0x24($sp)
/* 2F704 80054304 24050001 */  addiu     $a1, $zero, 0x1
/* 2F708 80054308 AE71001C */  sw        $s1, 0x1C($s3)
/* 2F70C 8005430C 8FA20024 */  lw        $v0, 0x24($sp)
/* 2F710 80054310 001080C0 */  sll       $s0, $s0, 3
/* 2F714 80054314 0200302D */  daddu     $a2, $s0, $zero
/* 2F718 80054318 0C015FE4 */  jal       alHeapAlloc
/* 2F71C 8005431C AE620024 */   sw       $v0, 0x24($s3)
/* 2F720 80054320 0040282D */  daddu     $a1, $v0, $zero
/* 2F724 80054324 8E62001C */  lw        $v0, 0x1C($s3)
/* 2F728 80054328 AE650020 */  sw        $a1, 0x20($s3)
/* 2F72C 8005432C 8FA40020 */  lw        $a0, 0x20($sp)
/* 2F730 80054330 0200302D */  daddu     $a2, $s0, $zero
/* 2F734 80054334 0C015380 */  jal       au_read_rom
/* 2F738 80054338 00442021 */   addu     $a0, $v0, $a0
/* 2F73C 8005433C 8FA20024 */  lw        $v0, 0x24($sp)
/* 2F740 80054340 8E650020 */  lw        $a1, 0x20($s3)
/* 2F744 80054344 0040182D */  daddu     $v1, $v0, $zero
/* 2F748 80054348 2442FFFF */  addiu     $v0, $v0, -0x1
/* 2F74C 8005434C 10600013 */  beqz      $v1, .L8005439C
/* 2F750 80054350 AFA20024 */   sw       $v0, 0x24($sp)
/* 2F754 80054354 3C0600FF */  lui       $a2, (0xFFFFFF >> 16)
/* 2F758 80054358 34C6FFFF */  ori       $a2, $a2, (0xFFFFFF & 0xFFFF)
/* 2F75C 8005435C 2407FFF0 */  addiu     $a3, $zero, -0x10
/* 2F760 80054360 24A40004 */  addiu     $a0, $a1, 0x4
.L80054364:
/* 2F764 80054364 8CA20000 */  lw        $v0, 0x0($a1)
/* 2F768 80054368 00461024 */  and       $v0, $v0, $a2
/* 2F76C 8005436C 1040000B */  beqz      $v0, .L8005439C
/* 2F770 80054370 24A50008 */   addiu    $a1, $a1, 0x8
/* 2F774 80054374 8C920000 */  lw        $s2, 0x0($a0)
/* 2F778 80054378 2642000F */  addiu     $v0, $s2, 0xF
/* 2F77C 8005437C 00471024 */  and       $v0, $v0, $a3
/* 2F780 80054380 AC820000 */  sw        $v0, 0x0($a0)
/* 2F784 80054384 8FA20024 */  lw        $v0, 0x24($sp)
/* 2F788 80054388 24840008 */  addiu     $a0, $a0, 0x8
/* 2F78C 8005438C 0040182D */  daddu     $v1, $v0, $zero
/* 2F790 80054390 2442FFFF */  addiu     $v0, $v0, -0x1
/* 2F794 80054394 1460FFF3 */  bnez      $v1, .L80054364
/* 2F798 80054398 AFA20024 */   sw       $v0, 0x24($sp)
.L8005439C:
/* 2F79C 8005439C 8FA20034 */  lw        $v0, 0x34($sp)
/* 2F7A0 800543A0 1040002D */  beqz      $v0, .L80054458
/* 2F7A4 800543A4 27A50050 */   addiu    $a1, $sp, 0x50
/* 2F7A8 800543A8 8EB10000 */  lw        $s1, 0x0($s5)
/* 2F7AC 800543AC 24060020 */  addiu     $a2, $zero, 0x20
/* 2F7B0 800543B0 02228821 */  addu      $s1, $s1, $v0
/* 2F7B4 800543B4 0C015380 */  jal       au_read_rom
/* 2F7B8 800543B8 0220202D */   daddu    $a0, $s1, $zero
/* 2F7BC 800543BC 0280202D */  daddu     $a0, $s4, $zero
/* 2F7C0 800543C0 24050001 */  addiu     $a1, $zero, 0x1
/* 2F7C4 800543C4 97A2005E */  lhu       $v0, 0x5E($sp)
/* 2F7C8 800543C8 97B0005C */  lhu       $s0, 0x5C($sp)
/* 2F7CC 800543CC 2442000F */  addiu     $v0, $v0, 0xF
/* 2F7D0 800543D0 3052FFF0 */  andi      $s2, $v0, 0xFFF0
/* 2F7D4 800543D4 0240302D */  daddu     $a2, $s2, $zero
/* 2F7D8 800543D8 0C015FE4 */  jal       alHeapAlloc
/* 2F7DC 800543DC 02308021 */   addu     $s0, $s1, $s0
/* 2F7E0 800543E0 0200202D */  daddu     $a0, $s0, $zero
/* 2F7E4 800543E4 0040282D */  daddu     $a1, $v0, $zero
/* 2F7E8 800543E8 0240302D */  daddu     $a2, $s2, $zero
/* 2F7EC 800543EC 0C015380 */  jal       au_read_rom
/* 2F7F0 800543F0 AE65002C */   sw       $a1, 0x2C($s3)
/* 2F7F4 800543F4 0280202D */  daddu     $a0, $s4, $zero
/* 2F7F8 800543F8 24050001 */  addiu     $a1, $zero, 0x1
/* 2F7FC 800543FC 97A20062 */  lhu       $v0, 0x62($sp)
/* 2F800 80054400 97B00060 */  lhu       $s0, 0x60($sp)
/* 2F804 80054404 2442000F */  addiu     $v0, $v0, 0xF
/* 2F808 80054408 3052FFF0 */  andi      $s2, $v0, 0xFFF0
/* 2F80C 8005440C 0240302D */  daddu     $a2, $s2, $zero
/* 2F810 80054410 0C015FE4 */  jal       alHeapAlloc
/* 2F814 80054414 02308021 */   addu     $s0, $s1, $s0
/* 2F818 80054418 0200202D */  daddu     $a0, $s0, $zero
/* 2F81C 8005441C 0040282D */  daddu     $a1, $v0, $zero
/* 2F820 80054420 0240302D */  daddu     $a2, $s2, $zero
/* 2F824 80054424 0C015380 */  jal       au_read_rom
/* 2F828 80054428 AE65003C */   sw       $a1, 0x3C($s3)
/* 2F82C 8005442C 97A20058 */  lhu       $v0, 0x58($sp)
/* 2F830 80054430 02228821 */  addu      $s1, $s1, $v0
/* 2F834 80054434 AE710034 */  sw        $s1, 0x34($s3)
/* 2F838 80054438 97A2005A */  lhu       $v0, 0x5A($sp)
/* 2F83C 8005443C 2442000F */  addiu     $v0, $v0, 0xF
/* 2F840 80054440 3042FFF0 */  andi      $v0, $v0, 0xFFF0
/* 2F844 80054444 AE620038 */  sw        $v0, 0x38($s3)
/* 2F848 80054448 97A2005E */  lhu       $v0, 0x5E($sp)
/* 2F84C 8005444C 000210C2 */  srl       $v0, $v0, 3
/* 2F850 80054450 2442FFFF */  addiu     $v0, $v0, -0x1
/* 2F854 80054454 AE620030 */  sw        $v0, 0x30($s3)
.L80054458:
/* 2F858 80054458 8FBF0088 */  lw        $ra, 0x88($sp)
/* 2F85C 8005445C 8FB50084 */  lw        $s5, 0x84($sp)
/* 2F860 80054460 8FB40080 */  lw        $s4, 0x80($sp)
/* 2F864 80054464 8FB3007C */  lw        $s3, 0x7C($sp)
/* 2F868 80054468 8FB20078 */  lw        $s2, 0x78($sp)
/* 2F86C 8005446C 8FB10074 */  lw        $s1, 0x74($sp)
/* 2F870 80054470 8FB00070 */  lw        $s0, 0x70($sp)
/* 2F874 80054474 03E00008 */  jr        $ra
/* 2F878 80054478 27BD0090 */   addiu    $sp, $sp, 0x90

### DECOMPILED C INSTRUCTIONS:

void au_load_INIT(AuGlobals* arg0, s32 romAddr, ALHeap* heap) {
    SBNHeader sbnHeader;
    INITHeader initHeader;
    SBNFileEntry* entry;
    s32 tableSize, initBase, size;
    s32 tblAddr, shortsAddr;
    s32* data;
    s32 numEntries;
    s32 tblOffset, shortsOffset;
    s32* romPtr = &arg0->baseRomOffset;

    au_read_rom(romAddr, &sbnHeader, sizeof(sbnHeader));
    numEntries = sbnHeader.numEntries;
    arg0->baseRomOffset = romAddr;
    tableSize = numEntries * sizeof(SBNFileEntry);
    arg0->fileListLength = sbnHeader.numEntries;
    arg0->sbnFileList = alHeapAlloc(heap, 1, tableSize);
    au_read_rom(arg0->baseRomOffset + sbnHeader.tableOffset, arg0->sbnFileList, tableSize);

    entry = arg0->sbnFileList;
    while (sbnHeader.numEntries--) {
        if ((entry->offset & 0xFFFFFF) == 0) {
            break;
        }

        size = entry->data;
        entry->data = (size + 0xF) & ~0xF;
        entry++;
    }

    if (sbnHeader.INIToffset != 0) {
        initBase = *romPtr + sbnHeader.INIToffset;
        au_read_rom(initBase, &initHeader, sizeof(initHeader));

        tblOffset = initHeader.tblOffset;
        size = (initHeader.tblSize + 0xF) & 0xFFF0;
        tblAddr = initBase + tblOffset;
        arg0->songList = alHeapAlloc(heap, 1, size);
        au_read_rom(tblAddr, arg0->songList, size);

        shortsOffset = initHeader.shortsOffset;
        size = (initHeader.shortsSize + 0xF) & 0xFFF0;
        shortsAddr = initBase + shortsOffset;
        arg0->mseqFileList = alHeapAlloc(heap, 1, size);
        au_read_rom(shortsAddr, arg0->mseqFileList, size);

        arg0->bkFileListOffset = initBase + initHeader.entriesOffset;
        arg0->bkListLength = (initHeader.entriesSize + 0xF) & 0xFFF0;
        arg0->songListLength = initHeader.tblSize / sizeof(InitSongEntry) - 1;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_entity_model_A
/* B83E8 80121CE8 27BDFF60 */  addiu     $sp, $sp, -0xA0
/* B83EC 80121CEC 0080302D */  daddu     $a2, $a0, $zero
/* B83F0 80121CF0 AFB1008C */  sw        $s1, 0x8C($sp)
/* B83F4 80121CF4 27B10028 */  addiu     $s1, $sp, 0x28
/* B83F8 80121CF8 3C07800A */  lui       $a3, %hi(gCurrentCamID)
/* B83FC 80121CFC 84E7A634 */  lh        $a3, %lo(gCurrentCamID)($a3)
/* B8400 80121D00 3C04800B */  lui       $a0, %hi(gCameras)
/* B8404 80121D04 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* B8408 80121D08 AFBF0094 */  sw        $ra, 0x94($sp)
/* B840C 80121D0C AFB20090 */  sw        $s2, 0x90($sp)
/* B8410 80121D10 AFB00088 */  sw        $s0, 0x88($sp)
/* B8414 80121D14 F7B40098 */  sdc1      $f20, 0x98($sp)
/* B8418 80121D18 00071080 */  sll       $v0, $a3, 2
/* B841C 80121D1C 00471021 */  addu      $v0, $v0, $a3
/* B8420 80121D20 00021080 */  sll       $v0, $v0, 2
/* B8424 80121D24 00471023 */  subu      $v0, $v0, $a3
/* B8428 80121D28 000218C0 */  sll       $v1, $v0, 3
/* B842C 80121D2C 00431021 */  addu      $v0, $v0, $v1
/* B8430 80121D30 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* B8434 80121D34 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* B8438 80121D38 000210C0 */  sll       $v0, $v0, 3
/* B843C 80121D3C 80630070 */  lb        $v1, 0x70($v1)
/* B8440 80121D40 10600004 */  beqz      $v1, .L80121D54
/* B8444 80121D44 00449021 */   addu     $s2, $v0, $a0
/* B8448 80121D48 30C20800 */  andi      $v0, $a2, 0x800
/* B844C 80121D4C 10400053 */  beqz      $v0, .L80121E9C
/* B8450 80121D50 00000000 */   nop
.L80121D54:
/* B8454 80121D54 2402F7FF */  addiu     $v0, $zero, -0x801
/* B8458 80121D58 00C23024 */  and       $a2, $a2, $v0
/* B845C 80121D5C 3C038015 */  lui       $v1, %hi(gCurrentEntityModelList)
/* B8460 80121D60 8C634370 */  lw        $v1, %lo(gCurrentEntityModelList)($v1)
/* B8464 80121D64 00061080 */  sll       $v0, $a2, 2
/* B8468 80121D68 00431021 */  addu      $v0, $v0, $v1
/* B846C 80121D6C 8C500000 */  lw        $s0, 0x0($v0)
/* B8470 80121D70 1200004A */  beqz      $s0, .L80121E9C
/* B8474 80121D74 00000000 */   nop
/* B8478 80121D78 8E030000 */  lw        $v1, 0x0($s0)
/* B847C 80121D7C 10600047 */  beqz      $v1, .L80121E9C
/* B8480 80121D80 30620100 */   andi     $v0, $v1, 0x100
/* B8484 80121D84 14400045 */  bnez      $v0, .L80121E9C
/* B8488 80121D88 30620020 */   andi     $v0, $v1, 0x20
/* B848C 80121D8C 14400043 */  bnez      $v0, .L80121E9C
/* B8490 80121D90 30620040 */   andi     $v0, $v1, 0x40
/* B8494 80121D94 14400041 */  bnez      $v0, .L80121E9C
/* B8498 80121D98 24020001 */   addiu    $v0, $zero, 0x1
/* B849C 80121D9C 00E21004 */  sllv      $v0, $v0, $a3
/* B84A0 80121DA0 00621024 */  and       $v0, $v1, $v0
/* B84A4 80121DA4 1040003D */  beqz      $v0, .L80121E9C
/* B84A8 80121DA8 26030018 */   addiu    $v1, $s0, 0x18
/* B84AC 80121DAC 00A0102D */  daddu     $v0, $a1, $zero
/* B84B0 80121DB0 24A40040 */  addiu     $a0, $a1, 0x40
.L80121DB4:
/* B84B4 80121DB4 8C480000 */  lw        $t0, 0x0($v0)
/* B84B8 80121DB8 8C490004 */  lw        $t1, 0x4($v0)
/* B84BC 80121DBC 8C4A0008 */  lw        $t2, 0x8($v0)
/* B84C0 80121DC0 8C4B000C */  lw        $t3, 0xC($v0)
/* B84C4 80121DC4 AC680000 */  sw        $t0, 0x0($v1)
/* B84C8 80121DC8 AC690004 */  sw        $t1, 0x4($v1)
/* B84CC 80121DCC AC6A0008 */  sw        $t2, 0x8($v1)
/* B84D0 80121DD0 AC6B000C */  sw        $t3, 0xC($v1)
/* B84D4 80121DD4 24420010 */  addiu     $v0, $v0, 0x10
/* B84D8 80121DD8 1444FFF6 */  bne       $v0, $a0, .L80121DB4
/* B84DC 80121DDC 24630010 */   addiu    $v1, $v1, 0x10
/* B84E0 80121DE0 27A40038 */  addiu     $a0, $sp, 0x38
/* B84E4 80121DE4 0C019D60 */  jal       guMtxL2F
/* B84E8 80121DE8 AE00005C */   sw       $zero, 0x5C($s0)
/* B84EC 80121DEC 264400D4 */  addiu     $a0, $s2, 0xD4
/* B84F0 80121DF0 C7A00068 */  lwc1      $f0, 0x68($sp)
/* B84F4 80121DF4 C7A2006C */  lwc1      $f2, 0x6C($sp)
/* B84F8 80121DF8 C7B40070 */  lwc1      $f20, 0x70($sp)
/* B84FC 80121DFC 27A20078 */  addiu     $v0, $sp, 0x78
/* B8500 80121E00 AFA20014 */  sw        $v0, 0x14($sp)
/* B8504 80121E04 27A2007C */  addiu     $v0, $sp, 0x7C
/* B8508 80121E08 AFA20018 */  sw        $v0, 0x18($sp)
/* B850C 80121E0C 27A20080 */  addiu     $v0, $sp, 0x80
/* B8510 80121E10 AFA2001C */  sw        $v0, 0x1C($sp)
/* B8514 80121E14 44050000 */  mfc1      $a1, $f0
/* B8518 80121E18 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* B851C 80121E1C 44810000 */  mtc1      $at, $f0
/* B8520 80121E20 44061000 */  mfc1      $a2, $f2
/* B8524 80121E24 4407A000 */  mfc1      $a3, $f20
/* B8528 80121E28 27A20084 */  addiu     $v0, $sp, 0x84
/* B852C 80121E2C AFA20020 */  sw        $v0, 0x20($sp)
/* B8530 80121E30 0C00A588 */  jal       transform_point
/* B8534 80121E34 E7A00010 */   swc1     $f0, 0x10($sp)
/* B8538 80121E38 82030004 */  lb        $v1, 0x4($s0)
/* B853C 80121E3C 3C028012 */  lui       $v0, %hi(appendGfx_entity_model)
/* B8540 80121E40 24421184 */  addiu     $v0, $v0, %lo(appendGfx_entity_model)
/* B8544 80121E44 AE300008 */  sw        $s0, 0x8($s1)
/* B8548 80121E48 AE22000C */  sw        $v0, 0xC($s1)
/* B854C 80121E4C AE230000 */  sw        $v1, 0x0($s1)
/* B8550 80121E50 8E020000 */  lw        $v0, 0x0($s0)
/* B8554 80121E54 3042F000 */  andi      $v0, $v0, 0xF000
/* B8558 80121E58 00021202 */  srl       $v0, $v0, 8
/* B855C 80121E5C 44821000 */  mtc1      $v0, $f2
/* B8560 80121E60 00000000 */  nop
/* B8564 80121E64 468010A1 */  cvt.d.w   $f2, $f2
/* B8568 80121E68 04430007 */  bgezl     $v0, .L80121E88
/* B856C 80121E6C 46201020 */   cvt.s.d  $f0, $f2
/* B8570 80121E70 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* B8574 80121E74 44810800 */  mtc1      $at, $f1
/* B8578 80121E78 44800000 */  mtc1      $zero, $f0
/* B857C 80121E7C 00000000 */  nop
/* B8580 80121E80 46201080 */  add.d     $f2, $f2, $f0
/* B8584 80121E84 46201020 */  cvt.s.d   $f0, $f2
.L80121E88:
/* B8588 80121E88 46140000 */  add.s     $f0, $f0, $f20
/* B858C 80121E8C 0220202D */  daddu     $a0, $s1, $zero
/* B8590 80121E90 4600010D */  trunc.w.s $f4, $f0
/* B8594 80121E94 0C047644 */  jal       queue_render_task
/* B8598 80121E98 E4840004 */   swc1     $f4, 0x4($a0)
.L80121E9C:
/* B859C 80121E9C 8FBF0094 */  lw        $ra, 0x94($sp)
/* B85A0 80121EA0 8FB20090 */  lw        $s2, 0x90($sp)
/* B85A4 80121EA4 8FB1008C */  lw        $s1, 0x8C($sp)
/* B85A8 80121EA8 8FB00088 */  lw        $s0, 0x88($sp)
/* B85AC 80121EAC D7B40098 */  ldc1      $f20, 0x98($sp)
/* B85B0 80121EB0 03E00008 */  jr        $ra
/* B85B4 80121EB4 27BD00A0 */   addiu    $sp, $sp, 0xA0

### DECOMPILED C INSTRUCTIONS:

void draw_entity_model_A(s32 modelIdx, Mtx* transformMtx) {
    EntityModel* model;
    RenderTask rt;
    RenderTask* rtPtr = &rt;
    Camera* camera = &gCameras[gCurrentCamID];
    Matrix4f mtx;
    f32 x, y, z, w;
    f32 inX, inY, inZ;

    if ((gGameStatusPtr->isBattle == 0) || (modelIdx & 0x800)) {
        modelIdx &= ~0x800;
        model = (*gCurrentEntityModelList)[modelIdx];

        if (model != NULL) {
            if (model->flags != 0) {
                if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
                    if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
                        if (!(model->flags & ENTITY_MODEL_FLAG_40) && (model->flags & (1 << gCurrentCamID))) {
                            model->transform = *transformMtx;
                            model->vertexArray = NULL;
                            guMtxL2F(mtx, transformMtx);
                            inX = mtx[3][0];
                            inY = mtx[3][1];
                            inZ = mtx[3][2];
                            transform_point(camera->perspectiveMatrix, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
                            rtPtr->renderMode = model->renderMode;
                            rtPtr->appendGfxArg = model;
                            rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
                            rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ;
                            queue_render_task(rtPtr);
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel partner_do_player_collision
/* 88AF0 800EF640 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 88AF4 800EF644 AFB1004C */  sw        $s1, 0x4C($sp)
/* 88AF8 800EF648 0080882D */  daddu     $s1, $a0, $zero
/* 88AFC 800EF64C AFB30054 */  sw        $s3, 0x54($sp)
/* 88B00 800EF650 3C13800B */  lui       $s3, %hi(gCameras + 0xD4)
/* 88B04 800EF654 26731E54 */  addiu     $s3, $s3, %lo(gCameras + 0xD4)
/* 88B08 800EF658 0260202D */  daddu     $a0, $s3, $zero
/* 88B0C 800EF65C AFB20050 */  sw        $s2, 0x50($sp)
/* 88B10 800EF660 3C128011 */  lui       $s2, %hi(gPlayerStatus)
/* 88B14 800EF664 2652EFC8 */  addiu     $s2, $s2, %lo(gPlayerStatus)
/* 88B18 800EF668 AFBF005C */  sw        $ra, 0x5C($sp)
/* 88B1C 800EF66C AFB40058 */  sw        $s4, 0x58($sp)
/* 88B20 800EF670 AFB00048 */  sw        $s0, 0x48($sp)
/* 88B24 800EF674 F7B40060 */  sdc1      $f20, 0x60($sp)
/* 88B28 800EF678 8E450028 */  lw        $a1, 0x28($s2)
/* 88B2C 800EF67C 8E46002C */  lw        $a2, 0x2C($s2)
/* 88B30 800EF680 8E470030 */  lw        $a3, 0x30($s2)
/* 88B34 800EF684 27A20028 */  addiu     $v0, $sp, 0x28
/* 88B38 800EF688 AFA20014 */  sw        $v0, 0x14($sp)
/* 88B3C 800EF68C 27A2002C */  addiu     $v0, $sp, 0x2C
/* 88B40 800EF690 AFA20018 */  sw        $v0, 0x18($sp)
/* 88B44 800EF694 27A20030 */  addiu     $v0, $sp, 0x30
/* 88B48 800EF698 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 88B4C 800EF69C 4481A000 */  mtc1      $at, $f20
/* 88B50 800EF6A0 27B00034 */  addiu     $s0, $sp, 0x34
/* 88B54 800EF6A4 AFA2001C */  sw        $v0, 0x1C($sp)
/* 88B58 800EF6A8 AFB00020 */  sw        $s0, 0x20($sp)
/* 88B5C 800EF6AC 0C00A588 */  jal       transform_point
/* 88B60 800EF6B0 E7B40010 */   swc1     $f20, 0x10($sp)
/* 88B64 800EF6B4 0260202D */  daddu     $a0, $s3, $zero
/* 88B68 800EF6B8 27A20038 */  addiu     $v0, $sp, 0x38
/* 88B6C 800EF6BC AFA20014 */  sw        $v0, 0x14($sp)
/* 88B70 800EF6C0 27A2003C */  addiu     $v0, $sp, 0x3C
/* 88B74 800EF6C4 AFA20018 */  sw        $v0, 0x18($sp)
/* 88B78 800EF6C8 27A20040 */  addiu     $v0, $sp, 0x40
/* 88B7C 800EF6CC AFB00020 */  sw        $s0, 0x20($sp)
/* 88B80 800EF6D0 26300038 */  addiu     $s0, $s1, 0x38
/* 88B84 800EF6D4 E7B40010 */  swc1      $f20, 0x10($sp)
/* 88B88 800EF6D8 AFA2001C */  sw        $v0, 0x1C($sp)
/* 88B8C 800EF6DC 8E250038 */  lw        $a1, 0x38($s1)
/* 88B90 800EF6E0 8E26003C */  lw        $a2, 0x3C($s1)
/* 88B94 800EF6E4 8E270040 */  lw        $a3, 0x40($s1)
/* 88B98 800EF6E8 0C00A588 */  jal       transform_point
/* 88B9C 800EF6EC 26340040 */   addiu    $s4, $s1, 0x40
/* 88BA0 800EF6F0 862200A6 */  lh        $v0, 0xA6($s1)
/* 88BA4 800EF6F4 864300B2 */  lh        $v1, 0xB2($s2)
/* 88BA8 800EF6F8 3C013F66 */  lui       $at, (0x3F666666 >> 16)
/* 88BAC 800EF6FC 34216666 */  ori       $at, $at, (0x3F666666 & 0xFFFF)
/* 88BB0 800EF700 44810000 */  mtc1      $at, $f0
/* 88BB4 800EF704 00431021 */  addu      $v0, $v0, $v1
/* 88BB8 800EF708 44824000 */  mtc1      $v0, $f8
/* 88BBC 800EF70C 00000000 */  nop
/* 88BC0 800EF710 46804220 */  cvt.s.w   $f8, $f8
/* 88BC4 800EF714 46004202 */  mul.s     $f8, $f8, $f0
/* 88BC8 800EF718 00000000 */  nop
/* 88BCC 800EF71C C7A60028 */  lwc1      $f6, 0x28($sp)
/* 88BD0 800EF720 C7A00038 */  lwc1      $f0, 0x38($sp)
/* 88BD4 800EF724 C7A4002C */  lwc1      $f4, 0x2C($sp)
/* 88BD8 800EF728 46003181 */  sub.s     $f6, $f6, $f0
/* 88BDC 800EF72C C7A0003C */  lwc1      $f0, 0x3C($sp)
/* 88BE0 800EF730 C7A20030 */  lwc1      $f2, 0x30($sp)
/* 88BE4 800EF734 46002101 */  sub.s     $f4, $f4, $f0
/* 88BE8 800EF738 C7A00040 */  lwc1      $f0, 0x40($sp)
/* 88BEC 800EF73C 46001081 */  sub.s     $f2, $f2, $f0
/* 88BF0 800EF740 46003185 */  abs.s     $f6, $f6
/* 88BF4 800EF744 E7A60028 */  swc1      $f6, 0x28($sp)
/* 88BF8 800EF748 46002105 */  abs.s     $f4, $f4
/* 88BFC 800EF74C 4608303E */  c.le.s    $f6, $f8
/* 88C00 800EF750 E7A4002C */  swc1      $f4, 0x2C($sp)
/* 88C04 800EF754 46001285 */  abs.s     $f10, $f2
/* 88C08 800EF758 4500002B */  bc1f      .L800EF808
/* 88C0C 800EF75C E7AA0030 */   swc1     $f10, 0x30($sp)
/* 88C10 800EF760 862200A8 */  lh        $v0, 0xA8($s1)
/* 88C14 800EF764 864300B0 */  lh        $v1, 0xB0($s2)
/* 88C18 800EF768 00431021 */  addu      $v0, $v0, $v1
/* 88C1C 800EF76C 44820000 */  mtc1      $v0, $f0
/* 88C20 800EF770 00000000 */  nop
/* 88C24 800EF774 46800020 */  cvt.s.w   $f0, $f0
/* 88C28 800EF778 4600203E */  c.le.s    $f4, $f0
/* 88C2C 800EF77C 00000000 */  nop
/* 88C30 800EF780 45000021 */  bc1f      .L800EF808
/* 88C34 800EF784 00000000 */   nop
/* 88C38 800EF788 3C014010 */  lui       $at, (0x40100000 >> 16)
/* 88C3C 800EF78C 44811800 */  mtc1      $at, $f3
/* 88C40 800EF790 44801000 */  mtc1      $zero, $f2
/* 88C44 800EF794 46005021 */  cvt.d.s   $f0, $f10
/* 88C48 800EF798 4622003E */  c.le.d    $f0, $f2
/* 88C4C 800EF79C 00000000 */  nop
/* 88C50 800EF7A0 45000019 */  bc1f      .L800EF808
/* 88C54 800EF7A4 00000000 */   nop
/* 88C58 800EF7A8 8E260038 */  lw        $a2, 0x38($s1)
/* 88C5C 800EF7AC 8E270040 */  lw        $a3, 0x40($s1)
/* 88C60 800EF7B0 C64C0028 */  lwc1      $f12, 0x28($s2)
/* 88C64 800EF7B4 0C00A720 */  jal       atan2
/* 88C68 800EF7B8 C64E0030 */   lwc1     $f14, 0x30($s2)
/* 88C6C 800EF7BC 4405A000 */  mfc1      $a1, $f20
/* 88C70 800EF7C0 44060000 */  mfc1      $a2, $f0
/* 88C74 800EF7C4 0C00EA95 */  jal       npc_move_heading
/* 88C78 800EF7C8 0220202D */   daddu    $a0, $s1, $zero
/* 88C7C 800EF7CC 0200202D */  daddu     $a0, $s0, $zero
/* 88C80 800EF7D0 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 88C84 800EF7D4 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 88C88 800EF7D8 3C064000 */  lui       $a2, (0x40000000 >> 16)
/* 88C8C 800EF7DC 00021880 */  sll       $v1, $v0, 2
/* 88C90 800EF7E0 00621821 */  addu      $v1, $v1, $v0
/* 88C94 800EF7E4 00031880 */  sll       $v1, $v1, 2
/* 88C98 800EF7E8 00621823 */  subu      $v1, $v1, $v0
/* 88C9C 800EF7EC 000310C0 */  sll       $v0, $v1, 3
/* 88CA0 800EF7F0 00621821 */  addu      $v1, $v1, $v0
/* 88CA4 800EF7F4 000318C0 */  sll       $v1, $v1, 3
/* 88CA8 800EF7F8 02631821 */  addu      $v1, $s3, $v1
/* 88CAC 800EF7FC 8C67FF98 */  lw        $a3, -0x68($v1)
/* 88CB0 800EF800 0C00A7E7 */  jal       add_vec2D_polar
/* 88CB4 800EF804 0280282D */   daddu    $a1, $s4, $zero
.L800EF808:
/* 88CB8 800EF808 8FBF005C */  lw        $ra, 0x5C($sp)
/* 88CBC 800EF80C 8FB40058 */  lw        $s4, 0x58($sp)
/* 88CC0 800EF810 8FB30054 */  lw        $s3, 0x54($sp)
/* 88CC4 800EF814 8FB20050 */  lw        $s2, 0x50($sp)
/* 88CC8 800EF818 8FB1004C */  lw        $s1, 0x4C($sp)
/* 88CCC 800EF81C 8FB00048 */  lw        $s0, 0x48($sp)
/* 88CD0 800EF820 D7B40060 */  ldc1      $f20, 0x60($sp)
/* 88CD4 800EF824 03E00008 */  jr        $ra
/* 88CD8 800EF828 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

void partner_do_player_collision(Npc* partner) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 playerScreenX;
    f32 playerScreenY;
    f32 playerScreenZ;
    f32 partnerScreenX;
    f32 partnerScreenY;
    f32 partnerScreenZ;
    f32 W;

    transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix,
                    playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f,
                    &playerScreenX, &playerScreenY, &playerScreenZ, &W);
    transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, partner->pos.x, partner->pos.y, partner->pos.z, 1.0f,
                    &partnerScreenX, &partnerScreenY, &partnerScreenZ, &W);
    playerScreenX = fabsf(playerScreenX - partnerScreenX);
    playerScreenY = fabsf(playerScreenY - partnerScreenY);
    playerScreenZ = fabsf(playerScreenZ - partnerScreenZ);
    if (playerScreenX <= (partner->collisionDiameter + playerStatus->colliderDiameter) * 0.9f &&
        playerScreenY <= partner->collisionHeight + playerStatus->colliderHeight && playerScreenZ <= 4.0)
    {
        npc_move_heading(partner, 1.0f,
                         atan2(playerStatus->position.x, playerStatus->position.z, partner->pos.x, partner->pos.z));
        add_vec2D_polar(&partner->pos.x, &partner->pos.z, 2.0f, gCameras[gCurrentCameraID].currentYaw);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_model_animator
/* B4FBC 8011E8BC 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* B4FC0 8011E8C0 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* B4FC4 8011E8C4 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* B4FC8 8011E8C8 AFBF001C */  sw        $ra, 0x1C($sp)
/* B4FCC 8011E8CC AFB20018 */  sw        $s2, 0x18($sp)
/* B4FD0 8011E8D0 AFB10014 */  sw        $s1, 0x14($sp)
/* B4FD4 8011E8D4 AFB00010 */  sw        $s0, 0x10($sp)
/* B4FD8 8011E8D8 80420070 */  lb        $v0, 0x70($v0)
/* B4FDC 8011E8DC 10400003 */  beqz      $v0, .L8011E8EC
/* B4FE0 8011E8E0 30820800 */   andi     $v0, $a0, 0x800
/* B4FE4 8011E8E4 10400055 */  beqz      $v0, .L8011EA3C
/* B4FE8 8011E8E8 00000000 */   nop
.L8011E8EC:
/* B4FEC 8011E8EC 2402F7FF */  addiu     $v0, $zero, -0x801
/* B4FF0 8011E8F0 00822024 */  and       $a0, $a0, $v0
/* B4FF4 8011E8F4 3C038015 */  lui       $v1, %hi(gCurrentAnimMeshListPtr)
/* B4FF8 8011E8F8 8C633A40 */  lw        $v1, %lo(gCurrentAnimMeshListPtr)($v1)
/* B4FFC 8011E8FC 00041080 */  sll       $v0, $a0, 2
/* B5000 8011E900 00431021 */  addu      $v0, $v0, $v1
/* B5004 8011E904 8C500000 */  lw        $s0, 0x0($v0)
/* B5008 8011E908 1200004C */  beqz      $s0, .L8011EA3C
/* B500C 8011E90C 00000000 */   nop
/* B5010 8011E910 8E040000 */  lw        $a0, 0x0($s0)
/* B5014 8011E914 10800049 */  beqz      $a0, .L8011EA3C
/* B5018 8011E918 3C020004 */   lui      $v0, (0x40000 >> 16)
/* B501C 8011E91C 00821024 */  and       $v0, $a0, $v0
/* B5020 8011E920 14400046 */  bnez      $v0, .L8011EA3C
/* B5024 8011E924 0000182D */   daddu    $v1, $zero, $zero
/* B5028 8011E928 C6000090 */  lwc1      $f0, 0x90($s0)
/* B502C 8011E92C C6020094 */  lwc1      $f2, 0x94($s0)
/* B5030 8011E930 2402FFBF */  addiu     $v0, $zero, -0x41
/* B5034 8011E934 46020001 */  sub.s     $f0, $f0, $f2
/* B5038 8011E938 44801000 */  mtc1      $zero, $f2
/* B503C 8011E93C 00821024 */  and       $v0, $a0, $v0
/* B5040 8011E940 AE020000 */  sw        $v0, 0x0($s0)
/* B5044 8011E944 4602003E */  c.le.s    $f0, $f2
/* B5048 8011E948 00000000 */  nop
/* B504C 8011E94C 45000014 */  bc1f      .L8011E9A0
/* B5050 8011E950 E6000090 */   swc1     $f0, 0x90($s0)
/* B5054 8011E954 30428000 */  andi      $v0, $v0, 0x8000
/* B5058 8011E958 14400008 */  bnez      $v0, .L8011E97C
/* B505C 8011E95C 0200202D */   daddu    $a0, $s0, $zero
.L8011E960:
/* B5060 8011E960 0C047AFC */  jal       step_model_animator
/* B5064 8011E964 0200202D */   daddu    $a0, $s0, $zero
/* B5068 8011E968 0040182D */  daddu     $v1, $v0, $zero
/* B506C 8011E96C 1C60FFFC */  bgtz      $v1, .L8011E960
/* B5070 8011E970 2402FFFF */   addiu    $v0, $zero, -0x1
/* B5074 8011E974 08047A69 */  j         .L8011E9A4
/* B5078 8011E978 00000000 */   nop
.L8011E97C:
/* B507C 8011E97C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* B5080 8011E980 44810000 */  mtc1      $at, $f0
/* B5084 8011E984 0C04819E */  jal       reload_mesh_animator_tree
/* B5088 8011E988 E6000090 */   swc1     $f0, 0x90($s0)
.L8011E98C:
/* B508C 8011E98C 0C0481BE */  jal       step_mesh_animator
/* B5090 8011E990 0200202D */   daddu    $a0, $s0, $zero
/* B5094 8011E994 0040182D */  daddu     $v1, $v0, $zero
/* B5098 8011E998 1C60FFFC */  bgtz      $v1, .L8011E98C
/* B509C 8011E99C 00000000 */   nop
.L8011E9A0:
/* B50A0 8011E9A0 2402FFFF */  addiu     $v0, $zero, -0x1
.L8011E9A4:
/* B50A4 8011E9A4 10620025 */  beq       $v1, $v0, .L8011EA3C
/* B50A8 8011E9A8 0200202D */   daddu    $a0, $s0, $zero
/* B50AC 8011E9AC 0C047C16 */  jal       animator_update_model_transforms
/* B50B0 8011E9B0 0000282D */   daddu    $a1, $zero, $zero
/* B50B4 8011E9B4 0000882D */  daddu     $s1, $zero, $zero
/* B50B8 8011E9B8 2412FFFF */  addiu     $s2, $zero, -0x1
/* B50BC 8011E9BC 3C108015 */  lui       $s0, %hi(D_801533C0)
/* B50C0 8011E9C0 261033C0 */  addiu     $s0, $s0, %lo(D_801533C0)
.L8011E9C4:
/* B50C4 8011E9C4 8E020000 */  lw        $v0, 0x0($s0)
/* B50C8 8011E9C8 04420008 */  bltzl     $v0, .L8011E9EC
/* B50CC 8011E9CC 26310001 */   addiu    $s1, $s1, 0x1
/* B50D0 8011E9D0 2442FFFF */  addiu     $v0, $v0, -0x1
/* B50D4 8011E9D4 14400004 */  bnez      $v0, .L8011E9E8
/* B50D8 8011E9D8 AE020000 */   sw       $v0, 0x0($s0)
/* B50DC 8011E9DC 8E040004 */  lw        $a0, 0x4($s0)
/* B50E0 8011E9E0 0C00AB1E */  jal       general_heap_free
/* B50E4 8011E9E4 AE120000 */   sw       $s2, 0x0($s0)
.L8011E9E8:
/* B50E8 8011E9E8 26310001 */  addiu     $s1, $s1, 0x1
.L8011E9EC:
/* B50EC 8011E9EC 2A220060 */  slti      $v0, $s1, 0x60
/* B50F0 8011E9F0 1440FFF4 */  bnez      $v0, .L8011E9C4
/* B50F4 8011E9F4 26100008 */   addiu    $s0, $s0, 0x8
/* B50F8 8011E9F8 0000882D */  daddu     $s1, $zero, $zero
/* B50FC 8011E9FC 2412FFFF */  addiu     $s2, $zero, -0x1
/* B5100 8011EA00 3C108015 */  lui       $s0, %hi(D_801536C0)
/* B5104 8011EA04 261036C0 */  addiu     $s0, $s0, %lo(D_801536C0)
.L8011EA08:
/* B5108 8011EA08 8E020000 */  lw        $v0, 0x0($s0)
/* B510C 8011EA0C 04420008 */  bltzl     $v0, .L8011EA30
/* B5110 8011EA10 26310001 */   addiu    $s1, $s1, 0x1
/* B5114 8011EA14 2442FFFF */  addiu     $v0, $v0, -0x1
/* B5118 8011EA18 14400004 */  bnez      $v0, .L8011EA2C
/* B511C 8011EA1C AE020000 */   sw       $v0, 0x0($s0)
/* B5120 8011EA20 8E040004 */  lw        $a0, 0x4($s0)
/* B5124 8011EA24 0C00AB1E */  jal       general_heap_free
/* B5128 8011EA28 AE120000 */   sw       $s2, 0x0($s0)
.L8011EA2C:
/* B512C 8011EA2C 26310001 */  addiu     $s1, $s1, 0x1
.L8011EA30:
/* B5130 8011EA30 2A220060 */  slti      $v0, $s1, 0x60
/* B5134 8011EA34 1440FFF4 */  bnez      $v0, .L8011EA08
/* B5138 8011EA38 26100008 */   addiu    $s0, $s0, 0x8
.L8011EA3C:
/* B513C 8011EA3C 8FBF001C */  lw        $ra, 0x1C($sp)
/* B5140 8011EA40 8FB20018 */  lw        $s2, 0x18($sp)
/* B5144 8011EA44 8FB10014 */  lw        $s1, 0x14($sp)
/* B5148 8011EA48 8FB00010 */  lw        $s0, 0x10($sp)
/* B514C 8011EA4C 03E00008 */  jr        $ra
/* B5150 8011EA50 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void update_model_animator(s32 animatorID) {
    if (!gGameStatusPtr->isBattle || animatorID & 0x800) {
        ModelAnimator* animator;

        animatorID &= ~0x800;
        animator = (*gCurrentAnimMeshListPtr)[animatorID];

        if (animator != NULL && animator->flags != 0) {
            s32 temp = 0;

            if (!(animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION)) {
                animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
                animator->nextUpdateTime -= animator->timeScale;
                if (animator->nextUpdateTime <= 0.0f) {
                    if (!(animator->flags & MODEL_ANIMATOR_FLAG_MESH)) {
                        do {
                            temp = step_model_animator(animator);
                        } while (temp > 0);
                    } else {
                        animator->nextUpdateTime = 1.0f;
                        reload_mesh_animator_tree(animator);
                        do {
                            temp = step_mesh_animator(animator);
                        } while (temp > 0);
                    }
                }

                if (temp != -1) {
                    s32 i;

                    animator_update_model_transforms(animator, NULL);

                    for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
                        if (D_801533C0[i].ttl >= 0) {
                            D_801533C0[i].ttl--;
                            if (D_801533C0[i].ttl == 0) {
                                D_801533C0[i].ttl = -1;
                                general_heap_free(D_801533C0[i].addr);
                            }
                        }
                    }

                    for (i = 0; i < ARRAY_COUNT(D_801536C0); i++) {
                        if (D_801536C0[i].ttl >= 0) {
                            D_801536C0[i].ttl--;
                            if (D_801536C0[i].ttl == 0) {
                                D_801536C0[i].ttl = -1;
                                general_heap_free(D_801536C0[i].addr);
                            }
                        }
                    }
                }
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_80260E90
/* 18F770 80260E90 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 18F774 80260E94 AFB50044 */  sw        $s5, 0x44($sp)
/* 18F778 80260E98 0080A82D */  daddu     $s5, $a0, $zero
/* 18F77C 80260E9C AFB10034 */  sw        $s1, 0x34($sp)
/* 18F780 80260EA0 0000882D */  daddu     $s1, $zero, $zero
/* 18F784 80260EA4 2405001D */  addiu     $a1, $zero, 0x1D
/* 18F788 80260EA8 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 18F78C 80260EAC 4480A000 */  mtc1      $zero, $f20
/* 18F790 80260EB0 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 18F794 80260EB4 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 18F798 80260EB8 AFBF0048 */  sw        $ra, 0x48($sp)
/* 18F79C 80260EBC AFB40040 */  sw        $s4, 0x40($sp)
/* 18F7A0 80260EC0 AFB3003C */  sw        $s3, 0x3C($sp)
/* 18F7A4 80260EC4 AFB20038 */  sw        $s2, 0x38($sp)
/* 18F7A8 80260EC8 AFB00030 */  sw        $s0, 0x30($sp)
/* 18F7AC 80260ECC F7B80060 */  sdc1      $f24, 0x60($sp)
/* 18F7B0 80260ED0 F7B60058 */  sdc1      $f22, 0x58($sp)
/* 18F7B4 80260ED4 8C5300D8 */  lw        $s3, 0xD8($v0)
/* 18F7B8 80260ED8 8442017A */  lh        $v0, 0x17A($v0)
/* 18F7BC 80260EDC 0260202D */  daddu     $a0, $s3, $zero
/* 18F7C0 80260EE0 00021140 */  sll       $v0, $v0, 5
/* 18F7C4 80260EE4 3C128008 */  lui       $s2, %hi(gItemTable + 0xC)
/* 18F7C8 80260EE8 02429021 */  addu      $s2, $s2, $v0
/* 18F7CC 80260EEC 865278EC */  lh        $s2, %lo(gItemTable + 0xC)($s2)
/* 18F7D0 80260EF0 92620191 */  lbu       $v0, 0x191($s3)
/* 18F7D4 80260EF4 C6620148 */  lwc1      $f2, 0x148($s3)
/* 18F7D8 80260EF8 44820000 */  mtc1      $v0, $f0
/* 18F7DC 80260EFC 00000000 */  nop
/* 18F7E0 80260F00 46800020 */  cvt.s.w   $f0, $f0
/* 18F7E4 80260F04 0C099CAB */  jal       player_team_is_ability_active
/* 18F7E8 80260F08 46001580 */   add.s    $f22, $f2, $f0
/* 18F7EC 80260F0C 50400048 */  beql      $v0, $zero, .L80261030
/* 18F7F0 80260F10 AEB10084 */   sw       $s1, 0x84($s5)
/* 18F7F4 80260F14 1A400045 */  blez      $s2, .L8026102C
/* 18F7F8 80260F18 3C0451EB */   lui      $a0, (0x51EB851F >> 16)
/* 18F7FC 80260F1C 3484851F */  ori       $a0, $a0, (0x51EB851F & 0xFFFF)
/* 18F800 80260F20 00121880 */  sll       $v1, $s2, 2
/* 18F804 80260F24 00721821 */  addu      $v1, $v1, $s2
/* 18F808 80260F28 00031100 */  sll       $v0, $v1, 4
/* 18F80C 80260F2C 00431023 */  subu      $v0, $v0, $v1
/* 18F810 80260F30 24420063 */  addiu     $v0, $v0, 0x63
/* 18F814 80260F34 00440018 */  mult      $v0, $a0
/* 18F818 80260F38 000217C3 */  sra       $v0, $v0, 31
/* 18F81C 80260F3C 00004010 */  mfhi      $t0
/* 18F820 80260F40 00081943 */  sra       $v1, $t0, 5
/* 18F824 80260F44 00629023 */  subu      $s2, $v1, $v0
/* 18F828 80260F48 0232102A */  slt       $v0, $s1, $s2
/* 18F82C 80260F4C 10400019 */  beqz      $v0, .L80260FB4
/* 18F830 80260F50 0220802D */   daddu    $s0, $s1, $zero
/* 18F834 80260F54 24140017 */  addiu     $s4, $zero, 0x17
/* 18F838 80260F58 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 18F83C 80260F5C 4481C000 */  mtc1      $at, $f24
/* 18F840 80260F60 24110001 */  addiu     $s1, $zero, 0x1
.L80260F64:
/* 18F844 80260F64 C6600144 */  lwc1      $f0, 0x144($s3)
/* 18F848 80260F68 C662014C */  lwc1      $f2, 0x14C($s3)
/* 18F84C 80260F6C 4600A10D */  trunc.w.s $f4, $f20
/* 18F850 80260F70 E7A40018 */  swc1      $f4, 0x18($sp)
/* 18F854 80260F74 24040157 */  addiu     $a0, $zero, 0x157
/* 18F858 80260F78 AFB10014 */  sw        $s1, 0x14($sp)
/* 18F85C 80260F7C 26310003 */  addiu     $s1, $s1, 0x3
/* 18F860 80260F80 26100001 */  addiu     $s0, $s0, 0x1
/* 18F864 80260F84 4406B000 */  mfc1      $a2, $f22
/* 18F868 80260F88 44050000 */  mfc1      $a1, $f0
/* 18F86C 80260F8C 44071000 */  mfc1      $a3, $f2
/* 18F870 80260F90 4618A500 */  add.s     $f20, $f20, $f24
/* 18F874 80260F94 AFB40010 */  sw        $s4, 0x10($sp)
/* 18F878 80260F98 0C04C4FD */  jal       make_item_entity
/* 18F87C 80260F9C AFA0001C */   sw       $zero, 0x1C($sp)
/* 18F880 80260FA0 0C03A830 */  jal       add_coins
/* 18F884 80260FA4 24040001 */   addiu    $a0, $zero, 0x1
/* 18F888 80260FA8 0212102A */  slt       $v0, $s0, $s2
/* 18F88C 80260FAC 1440FFED */  bnez      $v0, .L80260F64
/* 18F890 80260FB0 00000000 */   nop
.L80260FB4:
/* 18F894 80260FB4 00101040 */  sll       $v0, $s0, 1
/* 18F898 80260FB8 00501021 */  addu      $v0, $v0, $s0
/* 18F89C 80260FBC 2451001E */  addiu     $s1, $v0, 0x1E
/* 18F8A0 80260FC0 C6600144 */  lwc1      $f0, 0x144($s3)
/* 18F8A4 80260FC4 C6760148 */  lwc1      $f22, 0x148($s3)
/* 18F8A8 80260FC8 C662014C */  lwc1      $f2, 0x14C($s3)
/* 18F8AC 80260FCC 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* 18F8B0 80260FD0 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* 18F8B4 80260FD4 27A20020 */  addiu     $v0, $sp, 0x20
/* 18F8B8 80260FD8 AFA20010 */  sw        $v0, 0x10($sp)
/* 18F8BC 80260FDC 27A20024 */  addiu     $v0, $sp, 0x24
/* 18F8C0 80260FE0 AFA20014 */  sw        $v0, 0x14($sp)
/* 18F8C4 80260FE4 44050000 */  mfc1      $a1, $f0
/* 18F8C8 80260FE8 4406B000 */  mfc1      $a2, $f22
/* 18F8CC 80260FEC 44071000 */  mfc1      $a3, $f2
/* 18F8D0 80260FF0 27A20028 */  addiu     $v0, $sp, 0x28
/* 18F8D4 80260FF4 0C00B94E */  jal       get_screen_coords
/* 18F8D8 80260FF8 AFA20018 */   sw       $v0, 0x18($sp)
/* 18F8DC 80260FFC 3C048011 */  lui       $a0, %hi(HES_Refund)
/* 18F8E0 80261000 24848A64 */  addiu     $a0, $a0, %lo(HES_Refund)
/* 18F8E4 80261004 0C050529 */  jal       hud_element_create
/* 18F8E8 80261008 00000000 */   nop
/* 18F8EC 8026100C 8FA50020 */  lw        $a1, 0x20($sp)
/* 18F8F0 80261010 8FA60024 */  lw        $a2, 0x24($sp)
/* 18F8F4 80261014 0040202D */  daddu     $a0, $v0, $zero
/* 18F8F8 80261018 3C01802A */  lui       $at, %hi(RefundHudElem)
/* 18F8FC 8026101C AC24FBA0 */  sw        $a0, %lo(RefundHudElem)($at)
/* 18F900 80261020 24A50024 */  addiu     $a1, $a1, 0x24
/* 18F904 80261024 0C051261 */  jal       hud_element_set_render_pos
/* 18F908 80261028 24C6FFC1 */   addiu    $a2, $a2, -0x3F
.L8026102C:
/* 18F90C 8026102C AEB10084 */  sw        $s1, 0x84($s5)
.L80261030:
/* 18F910 80261030 8FBF0048 */  lw        $ra, 0x48($sp)
/* 18F914 80261034 8FB50044 */  lw        $s5, 0x44($sp)
/* 18F918 80261038 8FB40040 */  lw        $s4, 0x40($sp)
/* 18F91C 8026103C 8FB3003C */  lw        $s3, 0x3C($sp)
/* 18F920 80261040 8FB20038 */  lw        $s2, 0x38($sp)
/* 18F924 80261044 8FB10034 */  lw        $s1, 0x34($sp)
/* 18F928 80261048 8FB00030 */  lw        $s0, 0x30($sp)
/* 18F92C 8026104C D7B80060 */  ldc1      $f24, 0x60($sp)
/* 18F930 80261050 D7B60058 */  ldc1      $f22, 0x58($sp)
/* 18F934 80261054 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 18F938 80261058 24020002 */  addiu     $v0, $zero, 0x2
/* 18F93C 8026105C 03E00008 */  jr        $ra
/* 18F940 80261060 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

API_CALLABLE(GiveRefund) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player = battleStatus->playerActor;
    s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue;
    f32 angle = 0.0f;
    s32 delayTime = 0;
    f32 posX, posY, posZ;
    posY = player->currentPos.y + player->size.y;

    if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
        s32 i;
        s32 iconPosX, iconPosY, iconPosZ;

        // 75% of the item's sell value, rounded up
        sellValue = (sellValue * 75 + 99) / 100;

        for (i = 0; i < sellValue; i++) {
            posX = player->currentPos.x;
            posZ = player->currentPos.z;

            make_item_entity(ITEM_COIN, posX, posY, posZ, ITEM_SPAWN_MODE_TOSS_FADE1, (i * 3) + 1, angle, 0);
            add_coins(1);
            angle += 30.0f;
        }

        delayTime = (i * 3) + 30;

        posX = player->currentPos.x;
        posY = player->currentPos.y;
        posZ = player->currentPos.z;
        get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ);
        RefundHudElem = hud_element_create(&HES_Refund);
        hud_element_set_render_pos(RefundHudElem, iconPosX + 36, iconPosY - 63);
    }

    script->varTable[0] = delayTime;

    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel add_anim_node
/* B4E18 8011E718 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* B4E1C 8011E71C AFB20018 */  sw        $s2, 0x18($sp)
/* B4E20 8011E720 0080902D */  daddu     $s2, $a0, $zero
/* B4E24 8011E724 AFB3001C */  sw        $s3, 0x1C($sp)
/* B4E28 8011E728 00A0982D */  daddu     $s3, $a1, $zero
/* B4E2C 8011E72C AFB10014 */  sw        $s1, 0x14($sp)
/* B4E30 8011E730 00C0882D */  daddu     $s1, $a2, $zero
/* B4E34 8011E734 24040100 */  addiu     $a0, $zero, 0x100
/* B4E38 8011E738 AFBF0020 */  sw        $ra, 0x20($sp)
/* B4E3C 8011E73C 0C00AB39 */  jal       heap_malloc
/* B4E40 8011E740 AFB00010 */   sw       $s0, 0x10($sp)
/* B4E44 8011E744 0040802D */  daddu     $s0, $v0, $zero
/* B4E48 8011E748 16000003 */  bnez      $s0, .L8011E758
/* B4E4C 8011E74C 24020010 */   addiu    $v0, $zero, 0x10
.L8011E750:
/* B4E50 8011E750 080479D4 */  j         .L8011E750
/* B4E54 8011E754 00000000 */   nop
.L8011E758:
/* B4E58 8011E758 A60200F4 */  sh        $v0, 0xF4($s0)
/* B4E5C 8011E75C 8E220000 */  lw        $v0, 0x0($s1)
/* B4E60 8011E760 AE020000 */  sw        $v0, 0x0($s0)
/* B4E64 8011E764 C6200004 */  lwc1      $f0, 0x4($s1)
/* B4E68 8011E768 E6000084 */  swc1      $f0, 0x84($s0)
/* B4E6C 8011E76C C6200008 */  lwc1      $f0, 0x8($s1)
/* B4E70 8011E770 E6000088 */  swc1      $f0, 0x88($s0)
/* B4E74 8011E774 C620000C */  lwc1      $f0, 0xC($s1)
/* B4E78 8011E778 AE000090 */  sw        $zero, 0x90($s0)
/* B4E7C 8011E77C AE000094 */  sw        $zero, 0x94($s0)
/* B4E80 8011E780 AE000098 */  sw        $zero, 0x98($s0)
/* B4E84 8011E784 E600008C */  swc1      $f0, 0x8C($s0)
/* B4E88 8011E788 C6200010 */  lwc1      $f0, 0x10($s1)
/* B4E8C 8011E78C 2404001F */  addiu     $a0, $zero, 0x1F
/* B4E90 8011E790 E600009C */  swc1      $f0, 0x9C($s0)
/* B4E94 8011E794 C6200014 */  lwc1      $f0, 0x14($s1)
/* B4E98 8011E798 2603007C */  addiu     $v1, $s0, 0x7C
/* B4E9C 8011E79C E60000A0 */  swc1      $f0, 0xA0($s0)
/* B4EA0 8011E7A0 C6220018 */  lwc1      $f2, 0x18($s1)
/* B4EA4 8011E7A4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* B4EA8 8011E7A8 44810000 */  mtc1      $at, $f0
/* B4EAC 8011E7AC 2402FFFF */  addiu     $v0, $zero, -0x1
/* B4EB0 8011E7B0 A60200F8 */  sh        $v0, 0xF8($s0)
/* B4EB4 8011E7B4 E60000A8 */  swc1      $f0, 0xA8($s0)
/* B4EB8 8011E7B8 E60000AC */  swc1      $f0, 0xAC($s0)
/* B4EBC 8011E7BC E60000B0 */  swc1      $f0, 0xB0($s0)
/* B4EC0 8011E7C0 E60200A4 */  swc1      $f2, 0xA4($s0)
.L8011E7C4:
/* B4EC4 8011E7C4 AC600004 */  sw        $zero, 0x4($v1)
/* B4EC8 8011E7C8 2484FFFF */  addiu     $a0, $a0, -0x1
/* B4ECC 8011E7CC 0481FFFD */  bgez      $a0, .L8011E7C4
/* B4ED0 8011E7D0 2463FFFC */   addiu    $v1, $v1, -0x4
/* B4ED4 8011E7D4 92510014 */  lbu       $s1, 0x14($s2)
/* B4ED8 8011E7D8 1660001A */  bnez      $s3, .L8011E844
/* B4EDC 8011E7DC 26310001 */   addiu    $s1, $s1, 0x1
/* B4EE0 8011E7E0 8E420010 */  lw        $v0, 0x10($s2)
/* B4EE4 8011E7E4 14400003 */  bnez      $v0, .L8011E7F4
/* B4EE8 8011E7E8 A61100F6 */   sh       $s1, 0xF6($s0)
/* B4EEC 8011E7EC 08047A26 */  j         .L8011E898
/* B4EF0 8011E7F0 AE500010 */   sw       $s0, 0x10($s2)
.L8011E7F4:
/* B4EF4 8011E7F4 8E440010 */  lw        $a0, 0x10($s2)
/* B4EF8 8011E7F8 0C047837 */  jal       get_animator_child_with_id
/* B4EFC 8011E7FC 24050001 */   addiu    $a1, $zero, 0x1
/* B4F00 8011E800 14400003 */  bnez      $v0, .L8011E810
/* B4F04 8011E804 0000202D */   daddu    $a0, $zero, $zero
.L8011E808:
/* B4F08 8011E808 08047A02 */  j         .L8011E808
/* B4F0C 8011E80C 00000000 */   nop
.L8011E810:
/* B4F10 8011E810 0040182D */  daddu     $v1, $v0, $zero
.L8011E814:
/* B4F14 8011E814 8C620004 */  lw        $v0, 0x4($v1)
/* B4F18 8011E818 50400005 */  beql      $v0, $zero, .L8011E830
/* B4F1C 8011E81C AC700004 */   sw       $s0, 0x4($v1)
/* B4F20 8011E820 24840001 */  addiu     $a0, $a0, 0x1
/* B4F24 8011E824 28820020 */  slti      $v0, $a0, 0x20
/* B4F28 8011E828 1440FFFA */  bnez      $v0, .L8011E814
/* B4F2C 8011E82C 24630004 */   addiu    $v1, $v1, 0x4
.L8011E830:
/* B4F30 8011E830 28820020 */  slti      $v0, $a0, 0x20
/* B4F34 8011E834 14400019 */  bnez      $v0, .L8011E89C
/* B4F38 8011E838 0200102D */   daddu    $v0, $s0, $zero
.L8011E83C:
/* B4F3C 8011E83C 08047A0F */  j         .L8011E83C
/* B4F40 8011E840 00000000 */   nop
.L8011E844:
/* B4F44 8011E844 A61100F6 */  sh        $s1, 0xF6($s0)
/* B4F48 8011E848 8E440010 */  lw        $a0, 0x10($s2)
/* B4F4C 8011E84C 0C047837 */  jal       get_animator_child_with_id
/* B4F50 8011E850 0260282D */   daddu    $a1, $s3, $zero
/* B4F54 8011E854 14400003 */  bnez      $v0, .L8011E864
/* B4F58 8011E858 0000202D */   daddu    $a0, $zero, $zero
.L8011E85C:
/* B4F5C 8011E85C 08047A17 */  j         .L8011E85C
/* B4F60 8011E860 00000000 */   nop
.L8011E864:
/* B4F64 8011E864 0040182D */  daddu     $v1, $v0, $zero
.L8011E868:
/* B4F68 8011E868 8C620004 */  lw        $v0, 0x4($v1)
/* B4F6C 8011E86C 50400005 */  beql      $v0, $zero, .L8011E884
/* B4F70 8011E870 AC700004 */   sw       $s0, 0x4($v1)
/* B4F74 8011E874 24840001 */  addiu     $a0, $a0, 0x1
/* B4F78 8011E878 28820020 */  slti      $v0, $a0, 0x20
/* B4F7C 8011E87C 1440FFFA */  bnez      $v0, .L8011E868
/* B4F80 8011E880 24630004 */   addiu    $v1, $v1, 0x4
.L8011E884:
/* B4F84 8011E884 28820020 */  slti      $v0, $a0, 0x20
/* B4F88 8011E888 14400004 */  bnez      $v0, .L8011E89C
/* B4F8C 8011E88C 0200102D */   daddu    $v0, $s0, $zero
.L8011E890:
/* B4F90 8011E890 08047A24 */  j         .L8011E890
/* B4F94 8011E894 00000000 */   nop
.L8011E898:
/* B4F98 8011E898 0200102D */  daddu     $v0, $s0, $zero
.L8011E89C:
/* B4F9C 8011E89C A2510014 */  sb        $s1, 0x14($s2)
/* B4FA0 8011E8A0 8FBF0020 */  lw        $ra, 0x20($sp)
/* B4FA4 8011E8A4 8FB3001C */  lw        $s3, 0x1C($sp)
/* B4FA8 8011E8A8 8FB20018 */  lw        $s2, 0x18($sp)
/* B4FAC 8011E8AC 8FB10014 */  lw        $s1, 0x14($sp)
/* B4FB0 8011E8B0 8FB00010 */  lw        $s0, 0x10($sp)
/* B4FB4 8011E8B4 03E00008 */  jr        $ra
/* B4FB8 8011E8B8 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

AnimatorNode* add_anim_node(ModelAnimator* animator, s32 parentNodeID, AnimatorNodeBlueprint* nodeBP) {
    AnimatorNode* ret;
    AnimatorNode* child;
    s32 nextUniqueID;
    s32 nullRootNode;
    s32 i;

    ret = heap_malloc(sizeof(*ret));
    ASSERT(ret != NULL);

    ret->flags = MODEL_ANIMATOR_FLAG_ENABLED;
    ret->displayList = nodeBP->displayList;
    ret->basePos.x = nodeBP->basePos.x;
    ret->basePos.y = nodeBP->basePos.y;
    ret->basePos.z = nodeBP->basePos.z;
    ret->pos.x = 0.0f;
    ret->pos.y = 0.0f;
    ret->pos.z = 0.0f;
    ret->rotation.x = nodeBP->rotation.x;
    ret->rotation.y = nodeBP->rotation.y;
    ret->rotation.z = nodeBP->rotation.z;
    ret->scale.x = 1.0f;
    ret->scale.y = 1.0f;
    ret->scale.z = 1.0f;
    ret->vertexStartOffset = -1;

    for (i = 0; i < ARRAY_COUNT(ret->children); i++) {
        ret->children[i] = NULL;
    }

    nextUniqueID = animator->nextUniqueID;
    nextUniqueID = nextUniqueID + 1;

    if (parentNodeID == 0) {
        s32 nullRootNode = animator->rootNode == NULL; // todo ???

        ret->uniqueIndex = nextUniqueID;

        if (nullRootNode) {
            animator->rootNode = ret;
        } else {
            child = get_animator_child_with_id(animator->rootNode, 1);
            ASSERT(child != NULL);

            for (i = 0; i < ARRAY_COUNT(child->children); i++) {
                if (child->children[i] == NULL) {
                    child->children[i] = ret;
                    break;
                }
            }

            ASSERT(i < ARRAY_COUNT(child->children));
        }
    } else {
        ret->uniqueIndex = nextUniqueID;
        child = get_animator_child_with_id(animator->rootNode, parentNodeID);
        ASSERT(child != NULL);

        for (i = 0; i < ARRAY_COUNT(child->children); i++) {
            if (child->children[i] == NULL) {
                child->children[i] = ret;
                break;
            }
        }

        ASSERT(i < ARRAY_COUNT(child->children));
    }

    animator->nextUniqueID = nextUniqueID;
    return ret;
}