### RAW ASSEMBLY INSTRUCTIONS:

glabel aura_main
/* 377070 E0076000 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 377074 E0076004 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 377078 E0076008 4485B000 */  mtc1      $a1, $f22
/* 37707C E007600C F7B80048 */  sdc1      $f24, 0x48($sp)
/* 377080 E0076010 4486C000 */  mtc1      $a2, $f24
/* 377084 E0076014 AFB00028 */  sw        $s0, 0x28($sp)
/* 377088 E0076018 0080802D */  daddu     $s0, $a0, $zero
/* 37708C E007601C F7BA0050 */  sdc1      $f26, 0x50($sp)
/* 377090 E0076020 4487D000 */  mtc1      $a3, $f26
/* 377094 E0076024 27A40010 */  addiu     $a0, $sp, 0x10
/* 377098 E0076028 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 37709C E007602C C7B40068 */  lwc1      $f20, 0x68($sp)
/* 3770A0 E0076030 3C02E007 */  lui       $v0, %hi(aura_init)
/* 3770A4 E0076034 24426370 */  addiu     $v0, $v0, %lo(aura_init)
/* 3770A8 E0076038 AFA20018 */  sw        $v0, 0x18($sp)
/* 3770AC E007603C 3C02E007 */  lui       $v0, %hi(aura_update)
/* 3770B0 E0076040 24426378 */  addiu     $v0, $v0, %lo(aura_update)
/* 3770B4 E0076044 AFA2001C */  sw        $v0, 0x1C($sp)
/* 3770B8 E0076048 3C02E007 */  lui       $v0, %hi(aura_render)
/* 3770BC E007604C 24426808 */  addiu     $v0, $v0, %lo(aura_render)
/* 3770C0 E0076050 AFA20020 */  sw        $v0, 0x20($sp)
/* 3770C4 E0076054 2402003B */  addiu     $v0, $zero, 0x3B
/* 3770C8 E0076058 AFBF0030 */  sw        $ra, 0x30($sp)
/* 3770CC E007605C AFB1002C */  sw        $s1, 0x2C($sp)
/* 3770D0 E0076060 AFA00010 */  sw        $zero, 0x10($sp)
/* 3770D4 E0076064 AFA00024 */  sw        $zero, 0x24($sp)
/* 3770D8 E0076068 0C080124 */  jal       shim_create_effect_instance
/* 3770DC E007606C AFA20014 */   sw       $v0, 0x14($sp)
/* 3770E0 E0076070 24040070 */  addiu     $a0, $zero, 0x70
/* 3770E4 E0076074 24030001 */  addiu     $v1, $zero, 0x1
/* 3770E8 E0076078 0040882D */  daddu     $s1, $v0, $zero
/* 3770EC E007607C 0C08012C */  jal       shim_general_heap_malloc
/* 3770F0 E0076080 AE230008 */   sw       $v1, 0x8($s1)
/* 3770F4 E0076084 0040182D */  daddu     $v1, $v0, $zero
/* 3770F8 E0076088 14600003 */  bnez      $v1, .LE0076098
/* 3770FC E007608C AE22000C */   sw       $v0, 0xC($s1)
.LE0076090:
/* 377100 E0076090 0801D824 */  j         .LE0076090
/* 377104 E0076094 00000000 */   nop
.LE0076098:
/* 377108 E0076098 AC600064 */  sw        $zero, 0x64($v1)
/* 37710C E007609C C46A0064 */  lwc1      $f10, 0x64($v1)
/* 377110 E00760A0 24020064 */  addiu     $v0, $zero, 0x64
/* 377114 E00760A4 AC62002C */  sw        $v0, 0x2C($v1)
/* 377118 E00760A8 24020001 */  addiu     $v0, $zero, 0x1
/* 37711C E00760AC AC700000 */  sw        $s0, 0x0($v1)
/* 377120 E00760B0 AC600030 */  sw        $zero, 0x30($v1)
/* 377124 E00760B4 AC600028 */  sw        $zero, 0x28($v1)
/* 377128 E00760B8 E4760004 */  swc1      $f22, 0x4($v1)
/* 37712C E00760BC E4780008 */  swc1      $f24, 0x8($v1)
/* 377130 E00760C0 E47A000C */  swc1      $f26, 0xC($v1)
/* 377134 E00760C4 E46A0040 */  swc1      $f10, 0x40($v1)
/* 377138 E00760C8 E46A0034 */  swc1      $f10, 0x34($v1)
/* 37713C E00760CC E46A0058 */  swc1      $f10, 0x58($v1)
/* 377140 E00760D0 12020033 */  beq       $s0, $v0, .LE00761A0
/* 377144 E00760D4 E46A004C */   swc1     $f10, 0x4C($v1)
/* 377148 E00760D8 2A020002 */  slti      $v0, $s0, 0x2
/* 37714C E00760DC 10400005 */  beqz      $v0, .LE00760F4
/* 377150 E00760E0 24020002 */   addiu    $v0, $zero, 0x2
/* 377154 E00760E4 12000007 */  beqz      $s0, .LE0076104
/* 377158 E00760E8 2402004B */   addiu    $v0, $zero, 0x4B
/* 37715C E00760EC 0801D8A4 */  j         .LE0076290
/* 377160 E00760F0 00000000 */   nop
.LE00760F4:
/* 377164 E00760F4 12020045 */  beq       $s0, $v0, .LE007620C
/* 377168 E00760F8 24020019 */   addiu    $v0, $zero, 0x19
/* 37716C E00760FC 0801D8A4 */  j         .LE0076290
/* 377170 E0076100 00000000 */   nop
.LE0076104:
/* 377174 E0076104 A0620068 */  sb        $v0, 0x68($v1)
/* 377178 E0076108 A0620069 */  sb        $v0, 0x69($v1)
/* 37717C E007610C A062006A */  sb        $v0, 0x6A($v1)
/* 377180 E0076110 240200FF */  addiu     $v0, $zero, 0xFF
/* 377184 E0076114 4600A021 */  cvt.d.s   $f0, $f20
/* 377188 E0076118 3C01E007 */  lui       $at, (0xE0076EE0 >> 16)
/* 37718C E007611C D4226EE0 */  ldc1      $f2, (0xE0076EE0 & 0xFFFF)($at)
/* 377190 E0076120 3C01BF66 */  lui       $at, (0xBF666666 >> 16)
/* 377194 E0076124 34216666 */  ori       $at, $at, (0xBF666666 & 0xFFFF)
/* 377198 E0076128 44813000 */  mtc1      $at, $f6
/* 37719C E007612C 3C013D23 */  lui       $at, (0x3D23D70A >> 16)
/* 3771A0 E0076130 3421D70A */  ori       $at, $at, (0x3D23D70A & 0xFFFF)
/* 3771A4 E0076134 44812000 */  mtc1      $at, $f4
/* 3771A8 E0076138 3C013F66 */  lui       $at, (0x3F666666 >> 16)
/* 3771AC E007613C 34216666 */  ori       $at, $at, (0x3F666666 & 0xFFFF)
/* 3771B0 E0076140 44814000 */  mtc1      $at, $f8
/* 3771B4 E0076144 46220082 */  mul.d     $f2, $f0, $f2
/* 3771B8 E0076148 00000000 */  nop
/* 3771BC E007614C A062006B */  sb        $v0, 0x6B($v1)
/* 3771C0 E0076150 240200F7 */  addiu     $v0, $zero, 0xF7
/* 3771C4 E0076154 A062006C */  sb        $v0, 0x6C($v1)
/* 3771C8 E0076158 2402009B */  addiu     $v0, $zero, 0x9B
/* 3771CC E007615C A062006D */  sb        $v0, 0x6D($v1)
/* 3771D0 E0076160 A060006E */  sb        $zero, 0x6E($v1)
/* 3771D4 E0076164 E4740024 */  swc1      $f20, 0x24($v1)
/* 3771D8 E0076168 46200000 */  add.d     $f0, $f0, $f0
/* 3771DC E007616C E4660038 */  swc1      $f6, 0x38($v1)
/* 3771E0 E0076170 E4640044 */  swc1      $f4, 0x44($v1)
/* 3771E4 E0076174 E464003C */  swc1      $f4, 0x3C($v1)
/* 3771E8 E0076178 E4680048 */  swc1      $f8, 0x48($v1)
/* 3771EC E007617C E4660050 */  swc1      $f6, 0x50($v1)
/* 3771F0 E0076180 E464005C */  swc1      $f4, 0x5C($v1)
/* 3771F4 E0076184 E4640054 */  swc1      $f4, 0x54($v1)
/* 3771F8 E0076188 E4680060 */  swc1      $f8, 0x60($v1)
/* 3771FC E007618C 46200020 */  cvt.s.d   $f0, $f0
/* 377200 E0076190 E460001C */  swc1      $f0, 0x1C($v1)
/* 377204 E0076194 462010A0 */  cvt.s.d   $f2, $f2
/* 377208 E0076198 0801D8CB */  j         .LE007632C
/* 37720C E007619C E4620020 */   swc1     $f2, 0x20($v1)
.LE00761A0:
/* 377210 E00761A0 3C013D23 */  lui       $at, (0x3D23D70A >> 16)
/* 377214 E00761A4 3421D70A */  ori       $at, $at, (0x3D23D70A & 0xFFFF)
/* 377218 E00761A8 44810000 */  mtc1      $at, $f0
/* 37721C E00761AC 3C013F66 */  lui       $at, (0x3F666666 >> 16)
/* 377220 E00761B0 34216666 */  ori       $at, $at, (0x3F666666 & 0xFFFF)
/* 377224 E00761B4 44811000 */  mtc1      $at, $f2
/* 377228 E00761B8 2402004B */  addiu     $v0, $zero, 0x4B
/* 37722C E00761BC A0620068 */  sb        $v0, 0x68($v1)
/* 377230 E00761C0 A0620069 */  sb        $v0, 0x69($v1)
/* 377234 E00761C4 A062006A */  sb        $v0, 0x6A($v1)
/* 377238 E00761C8 240200FF */  addiu     $v0, $zero, 0xFF
/* 37723C E00761CC A062006B */  sb        $v0, 0x6B($v1)
/* 377240 E00761D0 A060006C */  sb        $zero, 0x6C($v1)
/* 377244 E00761D4 A060006D */  sb        $zero, 0x6D($v1)
/* 377248 E00761D8 A060006E */  sb        $zero, 0x6E($v1)
/* 37724C E00761DC E474001C */  swc1      $f20, 0x1C($v1)
/* 377250 E00761E0 E4740020 */  swc1      $f20, 0x20($v1)
/* 377254 E00761E4 E4740024 */  swc1      $f20, 0x24($v1)
/* 377258 E00761E8 E46A0038 */  swc1      $f10, 0x38($v1)
/* 37725C E00761EC E46A0050 */  swc1      $f10, 0x50($v1)
/* 377260 E00761F0 E4600044 */  swc1      $f0, 0x44($v1)
/* 377264 E00761F4 E460003C */  swc1      $f0, 0x3C($v1)
/* 377268 E00761F8 E4620048 */  swc1      $f2, 0x48($v1)
/* 37726C E00761FC E460005C */  swc1      $f0, 0x5C($v1)
/* 377270 E0076200 E4600054 */  swc1      $f0, 0x54($v1)
/* 377274 E0076204 0801D8CB */  j         .LE007632C
/* 377278 E0076208 E4620060 */   swc1     $f2, 0x60($v1)
.LE007620C:
/* 37727C E007620C 3C013D23 */  lui       $at, (0x3D23D70A >> 16)
/* 377280 E0076210 3421D70A */  ori       $at, $at, (0x3D23D70A & 0xFFFF)
/* 377284 E0076214 44810000 */  mtc1      $at, $f0
/* 377288 E0076218 3C013E4C */  lui       $at, (0x3E4CCCCD >> 16)
/* 37728C E007621C 3421CCCD */  ori       $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 377290 E0076220 44811000 */  mtc1      $at, $f2
/* 377294 E0076224 3C013FA6 */  lui       $at, (0x3FA66666 >> 16)
/* 377298 E0076228 34216666 */  ori       $at, $at, (0x3FA66666 & 0xFFFF)
/* 37729C E007622C 44812000 */  mtc1      $at, $f4
/* 3772A0 E0076230 3C013E23 */  lui       $at, (0x3E23D70A >> 16)
/* 3772A4 E0076234 3421D70A */  ori       $at, $at, (0x3E23D70A & 0xFFFF)
/* 3772A8 E0076238 44813000 */  mtc1      $at, $f6
/* 3772AC E007623C 3C013F85 */  lui       $at, (0x3F851EB8 >> 16)
/* 3772B0 E0076240 34211EB8 */  ori       $at, $at, (0x3F851EB8 & 0xFFFF)
/* 3772B4 E0076244 44814000 */  mtc1      $at, $f8
/* 3772B8 E0076248 A0620068 */  sb        $v0, 0x68($v1)
/* 3772BC E007624C 24020079 */  addiu     $v0, $zero, 0x79
/* 3772C0 E0076250 A0620069 */  sb        $v0, 0x69($v1)
/* 3772C4 E0076254 2402008E */  addiu     $v0, $zero, 0x8E
/* 3772C8 E0076258 A062006A */  sb        $v0, 0x6A($v1)
/* 3772CC E007625C 24020022 */  addiu     $v0, $zero, 0x22
/* 3772D0 E0076260 A062006B */  sb        $v0, 0x6B($v1)
/* 3772D4 E0076264 240200FF */  addiu     $v0, $zero, 0xFF
/* 3772D8 E0076268 A062006D */  sb        $v0, 0x6D($v1)
/* 3772DC E007626C 24020051 */  addiu     $v0, $zero, 0x51
/* 3772E0 E0076270 A060006C */  sb        $zero, 0x6C($v1)
/* 3772E4 E0076274 A062006E */  sb        $v0, 0x6E($v1)
/* 3772E8 E0076278 E474001C */  swc1      $f20, 0x1C($v1)
/* 3772EC E007627C E4740020 */  swc1      $f20, 0x20($v1)
/* 3772F0 E0076280 E4740024 */  swc1      $f20, 0x24($v1)
/* 3772F4 E0076284 E46A0038 */  swc1      $f10, 0x38($v1)
/* 3772F8 E0076288 0801D8C5 */  j         .LE0076314
/* 3772FC E007628C E46A0050 */   swc1     $f10, 0x50($v1)
.LE0076290:
/* 377300 E0076290 3C013D23 */  lui       $at, (0x3D23D70A >> 16)
/* 377304 E0076294 3421D70A */  ori       $at, $at, (0x3D23D70A & 0xFFFF)
/* 377308 E0076298 44810000 */  mtc1      $at, $f0
/* 37730C E007629C 3C013DCC */  lui       $at, (0x3DCCCCCD >> 16)
/* 377310 E00762A0 3421CCCD */  ori       $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 377314 E00762A4 44811000 */  mtc1      $at, $f2
/* 377318 E00762A8 3C013FD9 */  lui       $at, (0x3FD9999A >> 16)
/* 37731C E00762AC 3421999A */  ori       $at, $at, (0x3FD9999A & 0xFFFF)
/* 377320 E00762B0 44812000 */  mtc1      $at, $f4
/* 377324 E00762B4 3C013DA3 */  lui       $at, (0x3DA3D70A >> 16)
/* 377328 E00762B8 3421D70A */  ori       $at, $at, (0x3DA3D70A & 0xFFFF)
/* 37732C E00762BC 44813000 */  mtc1      $at, $f6
/* 377330 E00762C0 3C013FAE */  lui       $at, (0x3FAE147B >> 16)
/* 377334 E00762C4 3421147B */  ori       $at, $at, (0x3FAE147B & 0xFFFF)
/* 377338 E00762C8 44814000 */  mtc1      $at, $f8
/* 37733C E00762CC 240200B3 */  addiu     $v0, $zero, 0xB3
/* 377340 E00762D0 A0620068 */  sb        $v0, 0x68($v1)
/* 377344 E00762D4 240200A9 */  addiu     $v0, $zero, 0xA9
/* 377348 E00762D8 A0620069 */  sb        $v0, 0x69($v1)
/* 37734C E00762DC 24020055 */  addiu     $v0, $zero, 0x55
/* 377350 E00762E0 A062006A */  sb        $v0, 0x6A($v1)
/* 377354 E00762E4 24020022 */  addiu     $v0, $zero, 0x22
/* 377358 E00762E8 A062006B */  sb        $v0, 0x6B($v1)
/* 37735C E00762EC 240200FF */  addiu     $v0, $zero, 0xFF
/* 377360 E00762F0 A062006D */  sb        $v0, 0x6D($v1)
/* 377364 E00762F4 2402003F */  addiu     $v0, $zero, 0x3F
/* 377368 E00762F8 A060006C */  sb        $zero, 0x6C($v1)
/* 37736C E00762FC A062006E */  sb        $v0, 0x6E($v1)
/* 377370 E0076300 E474001C */  swc1      $f20, 0x1C($v1)
/* 377374 E0076304 E4740020 */  swc1      $f20, 0x20($v1)
/* 377378 E0076308 E4740024 */  swc1      $f20, 0x24($v1)
/* 37737C E007630C AC600038 */  sw        $zero, 0x38($v1)
/* 377380 E0076310 AC600050 */  sw        $zero, 0x50($v1)
.LE0076314:
/* 377384 E0076314 E4600044 */  swc1      $f0, 0x44($v1)
/* 377388 E0076318 E462003C */  swc1      $f2, 0x3C($v1)
/* 37738C E007631C E4640048 */  swc1      $f4, 0x48($v1)
/* 377390 E0076320 E460005C */  swc1      $f0, 0x5C($v1)
/* 377394 E0076324 E4660054 */  swc1      $f6, 0x54($v1)
/* 377398 E0076328 E4680060 */  swc1      $f8, 0x60($v1)
.LE007632C:
/* 37739C E007632C C4600004 */  lwc1      $f0, 0x4($v1)
/* 3773A0 E0076330 C4620008 */  lwc1      $f2, 0x8($v1)
/* 3773A4 E0076334 C464000C */  lwc1      $f4, 0xC($v1)
/* 3773A8 E0076338 E4600010 */  swc1      $f0, 0x10($v1)
/* 3773AC E007633C E4620014 */  swc1      $f2, 0x14($v1)
/* 3773B0 E0076340 E4640018 */  swc1      $f4, 0x18($v1)
/* 3773B4 E0076344 8FA2006C */  lw        $v0, 0x6C($sp)
/* 3773B8 E0076348 AC510000 */  sw        $s1, 0x0($v0)
/* 3773BC E007634C 8FBF0030 */  lw        $ra, 0x30($sp)
/* 3773C0 E0076350 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3773C4 E0076354 8FB00028 */  lw        $s0, 0x28($sp)
/* 3773C8 E0076358 D7BA0050 */  ldc1      $f26, 0x50($sp)
/* 3773CC E007635C D7B80048 */  ldc1      $f24, 0x48($sp)
/* 3773D0 E0076360 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 3773D4 E0076364 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 3773D8 E0076368 03E00008 */  jr        $ra
/* 3773DC E007636C 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance** outEffect) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    AuraFXData* part;
    s32 numParts = 1;
    f32 zero;

    bp.init = aura_init;
    bp.update = aura_update;
    bp.renderWorld = aura_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_AURA;

    effect = shim_create_effect_instance(bpPtr);
    effect->numParts = numParts;

    part = effect->data.aura = shim_general_heap_malloc(numParts * sizeof(*part));

    ASSERT(effect->data.aura != NULL);

    part->renderYaw = 0.0f;

    zero = 0.0f;
    part->unk_40 = zero;
    part->unk_34 = zero;
    part->unk_58 = zero;
    part->unk_4C = zero;

    part->fadeTime = 100;
    part->type = arg0;
    part->lifeTime = 0;
    part->primA = 0;
    part->posA.x = arg1;
    part->posA.y = arg2;
    part->posA.z = arg3;

    switch (arg0) {
        case 0:
            part->primR = 75;
            part->primG = 75;
            part->primB = 75;
            part->envR = 255;
            part->envG = 247;
            part->engB = 155;
            part->engA = 0;
            part->scale.x = arg4 * 2.0;
            part->scale.y = arg4 * 0.6;
            part->unk_24 = arg4;
            part->unk_38 = -0.9f;
            part->unk_44 = 0.04f;
            part->unk_3C = 0.04f;
            part->unk_48 = 0.9f;
            part->unk_50 = -0.9f;
            part->unk_5C = 0.04f;
            part->unk_54 = 0.04f;
            part->unk_60 = 0.9f;
            break;
        case 1:
            part->primR = 75;
            part->primG = 75;
            part->primB = 75;
            part->envR = 255;
            part->envG = 0;
            part->engB = 0;
            part->engA = 0;
            part->scale.x = arg4;
            part->scale.y = arg4;
            part->unk_24 = arg4;
            part->unk_38 = zero;
            part->unk_50 = zero;
            part->unk_44 = 0.04f;
            part->unk_3C = 0.04f;
            part->unk_48 = 0.9f;
            part->unk_5C = 0.04f;
            part->unk_54 = 0.04f;
            part->unk_60 = 0.9f;
            break;
        case 2:
            part->primR = 25;
            part->primG = 121;
            part->primB = 142;
            part->envR = 34;
            part->engB = 255;
            part->envG = 0;
            part->engA = 81;
            part->scale.x = arg4;
            part->scale.y = arg4;
            part->unk_24 = arg4;
            part->unk_38 = zero;
            part->unk_50 = zero;
            part->unk_44 = 0.04f;
            part->unk_3C = 0.2f;
            part->unk_48 = 1.3f;
            part->unk_5C = 0.04f;
            part->unk_54 = 0.16f;
            part->unk_60 = 1.04f;
            break;
        default:
            part->primR = 179;
            part->primG = 169;
            part->primB = 85;
            part->envR = 34;
            part->engB = 255;
            part->envG = 0;
            part->engA = 63;
            part->scale.x = arg4;
            part->scale.y = arg4;
            part->unk_24 = arg4;
            part->unk_38 = 0.0f;
            part->unk_50 = 0.0f;
            part->unk_44 = 0.04f;
            part->unk_3C = 0.1f;
            part->unk_48 = 1.7f;
            part->unk_5C = 0.04f;
            part->unk_54 = 0.08f;
            part->unk_60 = 1.36f;
            break;
    }

    part->posB.x = part->posA.x;
    part->posB.y = part->posA.y;
    part->posB.z = part->posA.z;

    *outEffect = effect;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_camera_mode_4
/* 9D10 8002E910 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 9D14 8002E914 AFB00010 */  sw        $s0, 0x10($sp)
/* 9D18 8002E918 0080802D */  daddu     $s0, $a0, $zero
/* 9D1C 8002E91C AFBF0014 */  sw        $ra, 0x14($sp)
/* 9D20 8002E920 F7BE0040 */  sdc1      $f30, 0x40($sp)
/* 9D24 8002E924 F7BC0038 */  sdc1      $f28, 0x38($sp)
/* 9D28 8002E928 F7BA0030 */  sdc1      $f26, 0x30($sp)
/* 9D2C 8002E92C F7B80028 */  sdc1      $f24, 0x28($sp)
/* 9D30 8002E930 F7B60020 */  sdc1      $f22, 0x20($sp)
/* 9D34 8002E934 F7B40018 */  sdc1      $f20, 0x18($sp)
/* 9D38 8002E938 8602001C */  lh        $v0, 0x1C($s0)
/* 9D3C 8002E93C C6000060 */  lwc1      $f0, 0x60($s0)
/* 9D40 8002E940 4482B000 */  mtc1      $v0, $f22
/* 9D44 8002E944 00000000 */  nop
/* 9D48 8002E948 4680B5A0 */  cvt.s.w   $f22, $f22
/* 9D4C 8002E94C 4600B03C */  c.lt.s    $f22, $f0
/* 9D50 8002E950 00000000 */  nop
/* 9D54 8002E954 45030001 */  bc1tl     .L8002E95C
/* 9D58 8002E958 4600B006 */   mov.s    $f0, $f22
.L8002E95C:
/* 9D5C 8002E95C 4600B107 */  neg.s     $f4, $f22
/* 9D60 8002E960 4604003C */  c.lt.s    $f0, $f4
/* 9D64 8002E964 00000000 */  nop
/* 9D68 8002E968 45030001 */  bc1tl     .L8002E970
/* 9D6C 8002E96C 46002006 */   mov.s    $f0, $f4
.L8002E970:
/* 9D70 8002E970 C6080068 */  lwc1      $f8, 0x68($s0)
/* 9D74 8002E974 8602001E */  lh        $v0, 0x1E($s0)
/* 9D78 8002E978 4482C000 */  mtc1      $v0, $f24
/* 9D7C 8002E97C 00000000 */  nop
/* 9D80 8002E980 4680C620 */  cvt.s.w   $f24, $f24
/* 9D84 8002E984 4608C03C */  c.lt.s    $f24, $f8
/* 9D88 8002E988 00000000 */  nop
/* 9D8C 8002E98C 45000002 */  bc1f      .L8002E998
/* 9D90 8002E990 E6000054 */   swc1     $f0, 0x54($s0)
/* 9D94 8002E994 4600C206 */  mov.s     $f8, $f24
.L8002E998:
/* 9D98 8002E998 4600C007 */  neg.s     $f0, $f24
/* 9D9C 8002E99C 4600403C */  c.lt.s    $f8, $f0
/* 9DA0 8002E9A0 00000000 */  nop
/* 9DA4 8002E9A4 45030001 */  bc1tl     .L8002E9AC
/* 9DA8 8002E9A8 46000206 */   mov.s    $f8, $f0
.L8002E9AC:
/* 9DAC 8002E9AC 86020020 */  lh        $v0, 0x20($s0)
/* 9DB0 8002E9B0 3C01800A */  lui       $at, %hi(D_8009A5EC)
/* 9DB4 8002E9B4 C424A5EC */  lwc1      $f4, %lo(D_8009A5EC)($at)
/* 9DB8 8002E9B8 AE000070 */  sw        $zero, 0x70($s0)
/* 9DBC 8002E9BC 44821000 */  mtc1      $v0, $f2
/* 9DC0 8002E9C0 00000000 */  nop
/* 9DC4 8002E9C4 468010A0 */  cvt.s.w   $f2, $f2
/* 9DC8 8002E9C8 46041082 */  mul.s     $f2, $f2, $f4
/* 9DCC 8002E9CC 00000000 */  nop
/* 9DD0 8002E9D0 86020022 */  lh        $v0, 0x22($s0)
/* 9DD4 8002E9D4 C6060070 */  lwc1      $f6, 0x70($s0)
/* 9DD8 8002E9D8 44820000 */  mtc1      $v0, $f0
/* 9DDC 8002E9DC 00000000 */  nop
/* 9DE0 8002E9E0 46800020 */  cvt.s.w   $f0, $f0
/* 9DE4 8002E9E4 86020006 */  lh        $v0, 0x6($s0)
/* 9DE8 8002E9E8 46040002 */  mul.s     $f0, $f0, $f4
/* 9DEC 8002E9EC 00000000 */  nop
/* 9DF0 8002E9F0 E608005C */  swc1      $f8, 0x5C($s0)
/* 9DF4 8002E9F4 AE000074 */  sw        $zero, 0x74($s0)
/* 9DF8 8002E9F8 E6060084 */  swc1      $f6, 0x84($s0)
/* 9DFC 8002E9FC E6020078 */  swc1      $f2, 0x78($s0)
/* 9E00 8002EA00 10400047 */  beqz      $v0, .L8002EB20
/* 9E04 8002EA04 E600007C */   swc1     $f0, 0x7C($s0)
/* 9E08 8002EA08 4480F000 */  mtc1      $zero, $f30
/* 9E0C 8002EA0C C6020074 */  lwc1      $f2, 0x74($s0)
/* 9E10 8002EA10 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 9E14 8002EA14 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 9E18 8002EA18 4481B000 */  mtc1      $at, $f22
/* 9E1C 8002EA1C C6080054 */  lwc1      $f8, 0x54($s0)
/* 9E20 8002EA20 C6000058 */  lwc1      $f0, 0x58($s0)
/* 9E24 8002EA24 C604007C */  lwc1      $f4, 0x7C($s0)
/* 9E28 8002EA28 C606005C */  lwc1      $f6, 0x5C($s0)
/* 9E2C 8002EA2C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 9E30 8002EA30 4481A000 */  mtc1      $at, $f20
/* 9E34 8002EA34 46161082 */  mul.s     $f2, $f2, $f22
/* 9E38 8002EA38 00000000 */  nop
/* 9E3C 8002EA3C A6000006 */  sh        $zero, 0x6($s0)
/* 9E40 8002EA40 E61E0098 */  swc1      $f30, 0x98($s0)
/* 9E44 8002EA44 E61E009C */  swc1      $f30, 0x9C($s0)
/* 9E48 8002EA48 46040000 */  add.s     $f0, $f0, $f4
/* 9E4C 8002EA4C E6080048 */  swc1      $f8, 0x48($s0)
/* 9E50 8002EA50 E6060050 */  swc1      $f6, 0x50($s0)
/* 9E54 8002EA54 E600004C */  swc1      $f0, 0x4C($s0)
/* 9E58 8002EA58 46141683 */  div.s     $f26, $f2, $f20
/* 9E5C 8002EA5C 0C00A85B */  jal       sin_rad
/* 9E60 8002EA60 4600D306 */   mov.s    $f12, $f26
/* 9E64 8002EA64 46000706 */  mov.s     $f28, $f0
/* 9E68 8002EA68 0C00A874 */  jal       cos_rad
/* 9E6C 8002EA6C 4600D306 */   mov.s    $f12, $f26
/* 9E70 8002EA70 46000286 */  mov.s     $f10, $f0
/* 9E74 8002EA74 461E5202 */  mul.s     $f8, $f10, $f30
/* 9E78 8002EA78 00000000 */  nop
/* 9E7C 8002EA7C 4600F087 */  neg.s     $f2, $f30
/* 9E80 8002EA80 4602E082 */  mul.s     $f2, $f28, $f2
/* 9E84 8002EA84 00000000 */  nop
/* 9E88 8002EA88 C6180078 */  lwc1      $f24, 0x78($s0)
/* 9E8C 8002EA8C 461CC102 */  mul.s     $f4, $f24, $f28
/* 9E90 8002EA90 00000000 */  nop
/* 9E94 8002EA94 460AC182 */  mul.s     $f6, $f24, $f10
/* 9E98 8002EA98 00000000 */  nop
/* 9E9C 8002EA9C C6000070 */  lwc1      $f0, 0x70($s0)
/* 9EA0 8002EAA0 46160002 */  mul.s     $f0, $f0, $f22
/* 9EA4 8002EAA4 00000000 */  nop
/* 9EA8 8002EAA8 4600F286 */  mov.s     $f10, $f30
/* 9EAC 8002EAAC 46005586 */  mov.s     $f22, $f10
/* 9EB0 8002EAB0 46044780 */  add.s     $f30, $f8, $f4
/* 9EB4 8002EAB4 46140683 */  div.s     $f26, $f0, $f20
/* 9EB8 8002EAB8 4600D306 */  mov.s     $f12, $f26
/* 9EBC 8002EABC 0C00A85B */  jal       sin_rad
/* 9EC0 8002EAC0 46061600 */   add.s    $f24, $f2, $f6
/* 9EC4 8002EAC4 46000706 */  mov.s     $f28, $f0
/* 9EC8 8002EAC8 0C00A874 */  jal       cos_rad
/* 9ECC 8002EACC 4600D306 */   mov.s    $f12, $f26
/* 9ED0 8002EAD0 46000286 */  mov.s     $f10, $f0
/* 9ED4 8002EAD4 46165182 */  mul.s     $f6, $f10, $f22
/* 9ED8 8002EAD8 00000000 */  nop
/* 9EDC 8002EADC 4616E102 */  mul.s     $f4, $f28, $f22
/* 9EE0 8002EAE0 00000000 */  nop
/* 9EE4 8002EAE4 461CC082 */  mul.s     $f2, $f24, $f28
/* 9EE8 8002EAE8 00000000 */  nop
/* 9EEC 8002EAEC 460AC002 */  mul.s     $f0, $f24, $f10
/* 9EF0 8002EAF0 00000000 */  nop
/* 9EF4 8002EAF4 46023281 */  sub.s     $f10, $f6, $f2
/* 9EF8 8002EAF8 46002180 */  add.s     $f6, $f4, $f0
/* 9EFC 8002EAFC C600004C */  lwc1      $f0, 0x4C($s0)
/* 9F00 8002EB00 461E0000 */  add.s     $f0, $f0, $f30
/* 9F04 8002EB04 C6040048 */  lwc1      $f4, 0x48($s0)
/* 9F08 8002EB08 460A2100 */  add.s     $f4, $f4, $f10
/* 9F0C 8002EB0C C6020050 */  lwc1      $f2, 0x50($s0)
/* 9F10 8002EB10 46061080 */  add.s     $f2, $f2, $f6
/* 9F14 8002EB14 E6000040 */  swc1      $f0, 0x40($s0)
/* 9F18 8002EB18 E604003C */  swc1      $f4, 0x3C($s0)
/* 9F1C 8002EB1C E6020044 */  swc1      $f2, 0x44($s0)
.L8002EB20:
/* 9F20 8002EB20 4480F000 */  mtc1      $zero, $f30
/* 9F24 8002EB24 C6020074 */  lwc1      $f2, 0x74($s0)
/* 9F28 8002EB28 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 9F2C 8002EB2C 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 9F30 8002EB30 4481B000 */  mtc1      $at, $f22
/* 9F34 8002EB34 C6080054 */  lwc1      $f8, 0x54($s0)
/* 9F38 8002EB38 46161082 */  mul.s     $f2, $f2, $f22
/* 9F3C 8002EB3C 00000000 */  nop
/* 9F40 8002EB40 C6000058 */  lwc1      $f0, 0x58($s0)
/* 9F44 8002EB44 C604007C */  lwc1      $f4, 0x7C($s0)
/* 9F48 8002EB48 C606005C */  lwc1      $f6, 0x5C($s0)
/* 9F4C 8002EB4C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 9F50 8002EB50 4481A000 */  mtc1      $at, $f20
/* 9F54 8002EB54 46040000 */  add.s     $f0, $f0, $f4
/* 9F58 8002EB58 E6080048 */  swc1      $f8, 0x48($s0)
/* 9F5C 8002EB5C E6060050 */  swc1      $f6, 0x50($s0)
/* 9F60 8002EB60 E600004C */  swc1      $f0, 0x4C($s0)
/* 9F64 8002EB64 46141683 */  div.s     $f26, $f2, $f20
/* 9F68 8002EB68 0C00A85B */  jal       sin_rad
/* 9F6C 8002EB6C 4600D306 */   mov.s    $f12, $f26
/* 9F70 8002EB70 46000706 */  mov.s     $f28, $f0
/* 9F74 8002EB74 0C00A874 */  jal       cos_rad
/* 9F78 8002EB78 4600D306 */   mov.s    $f12, $f26
/* 9F7C 8002EB7C 46000286 */  mov.s     $f10, $f0
/* 9F80 8002EB80 461E5202 */  mul.s     $f8, $f10, $f30
/* 9F84 8002EB84 00000000 */  nop
/* 9F88 8002EB88 4600F087 */  neg.s     $f2, $f30
/* 9F8C 8002EB8C 4602E082 */  mul.s     $f2, $f28, $f2
/* 9F90 8002EB90 00000000 */  nop
/* 9F94 8002EB94 C6180078 */  lwc1      $f24, 0x78($s0)
/* 9F98 8002EB98 461CC102 */  mul.s     $f4, $f24, $f28
/* 9F9C 8002EB9C 00000000 */  nop
/* 9FA0 8002EBA0 460AC182 */  mul.s     $f6, $f24, $f10
/* 9FA4 8002EBA4 00000000 */  nop
/* 9FA8 8002EBA8 C6000070 */  lwc1      $f0, 0x70($s0)
/* 9FAC 8002EBAC 46160002 */  mul.s     $f0, $f0, $f22
/* 9FB0 8002EBB0 00000000 */  nop
/* 9FB4 8002EBB4 4600F286 */  mov.s     $f10, $f30
/* 9FB8 8002EBB8 46005586 */  mov.s     $f22, $f10
/* 9FBC 8002EBBC 46044780 */  add.s     $f30, $f8, $f4
/* 9FC0 8002EBC0 46140683 */  div.s     $f26, $f0, $f20
/* 9FC4 8002EBC4 4600D306 */  mov.s     $f12, $f26
/* 9FC8 8002EBC8 0C00A85B */  jal       sin_rad
/* 9FCC 8002EBCC 46061600 */   add.s    $f24, $f2, $f6
/* 9FD0 8002EBD0 46000706 */  mov.s     $f28, $f0
/* 9FD4 8002EBD4 0C00A874 */  jal       cos_rad
/* 9FD8 8002EBD8 4600D306 */   mov.s    $f12, $f26
/* 9FDC 8002EBDC 46000286 */  mov.s     $f10, $f0
/* 9FE0 8002EBE0 46165102 */  mul.s     $f4, $f10, $f22
/* 9FE4 8002EBE4 00000000 */  nop
/* 9FE8 8002EBE8 4616E182 */  mul.s     $f6, $f28, $f22
/* 9FEC 8002EBEC 00000000 */  nop
/* 9FF0 8002EBF0 461CC002 */  mul.s     $f0, $f24, $f28
/* 9FF4 8002EBF4 00000000 */  nop
/* 9FF8 8002EBF8 460AC082 */  mul.s     $f2, $f24, $f10
/* 9FFC 8002EBFC 00000000 */  nop
/* A000 8002EC00 46002281 */  sub.s     $f10, $f4, $f0
/* A004 8002EC04 46023180 */  add.s     $f6, $f6, $f2
/* A008 8002EC08 C602004C */  lwc1      $f2, 0x4C($s0)
/* A00C 8002EC0C 461E1080 */  add.s     $f2, $f2, $f30
/* A010 8002EC10 C6000048 */  lwc1      $f0, 0x48($s0)
/* A014 8002EC14 8E060048 */  lw        $a2, 0x48($s0)
/* A018 8002EC18 460A0000 */  add.s     $f0, $f0, $f10
/* A01C 8002EC1C C60E0050 */  lwc1      $f14, 0x50($s0)
/* A020 8002EC20 8E070050 */  lw        $a3, 0x50($s0)
/* A024 8002EC24 46067380 */  add.s     $f14, $f14, $f6
/* A028 8002EC28 E6020040 */  swc1      $f2, 0x40($s0)
/* A02C 8002EC2C E600003C */  swc1      $f0, 0x3C($s0)
/* A030 8002EC30 46000306 */  mov.s     $f12, $f0
/* A034 8002EC34 0C00A720 */  jal       atan2
/* A038 8002EC38 E60E0044 */   swc1     $f14, 0x44($s0)
/* A03C 8002EC3C 4600B506 */  mov.s     $f20, $f22
/* A040 8002EC40 C6040048 */  lwc1      $f4, 0x48($s0)
/* A044 8002EC44 C602003C */  lwc1      $f2, 0x3C($s0)
/* A048 8002EC48 4600A306 */  mov.s     $f12, $f20
/* A04C 8002EC4C 46022581 */  sub.s     $f22, $f4, $f2
/* A050 8002EC50 C6040050 */  lwc1      $f4, 0x50($s0)
/* A054 8002EC54 C6020044 */  lwc1      $f2, 0x44($s0)
/* A058 8002EC58 4600A386 */  mov.s     $f14, $f20
/* A05C 8002EC5C 46022601 */  sub.s     $f24, $f4, $f2
/* A060 8002EC60 C604004C */  lwc1      $f4, 0x4C($s0)
/* A064 8002EC64 C6020040 */  lwc1      $f2, 0x40($s0)
/* A068 8002EC68 4406B000 */  mfc1      $a2, $f22
/* A06C 8002EC6C 4407C000 */  mfc1      $a3, $f24
/* A070 8002EC70 46022781 */  sub.s     $f30, $f4, $f2
/* A074 8002EC74 0C00A720 */  jal       atan2
/* A078 8002EC78 E600006C */   swc1     $f0, 0x6C($s0)
/* A07C 8002EC7C 4616B102 */  mul.s     $f4, $f22, $f22
/* A080 8002EC80 00000000 */  nop
/* A084 8002EC84 4618C082 */  mul.s     $f2, $f24, $f24
/* A088 8002EC88 00000000 */  nop
/* A08C 8002EC8C 46022300 */  add.s     $f12, $f4, $f2
/* A090 8002EC90 46000007 */  neg.s     $f0, $f0
/* A094 8002EC94 E6000090 */  swc1      $f0, 0x90($s0)
/* A098 8002EC98 46006004 */  sqrt.s    $f0, $f12
/* A09C 8002EC9C 46000032 */  c.eq.s    $f0, $f0
/* A0A0 8002ECA0 00000000 */  nop
/* A0A4 8002ECA4 45030004 */  bc1tl     .L8002ECB8
/* A0A8 8002ECA8 4600A306 */   mov.s    $f12, $f20
/* A0AC 8002ECAC 0C0187BC */  jal       sqrtf
/* A0B0 8002ECB0 00000000 */   nop
/* A0B4 8002ECB4 4600A306 */  mov.s     $f12, $f20
.L8002ECB8:
/* A0B8 8002ECB8 46000007 */  neg.s     $f0, $f0
/* A0BC 8002ECBC 4406F000 */  mfc1      $a2, $f30
/* A0C0 8002ECC0 44070000 */  mfc1      $a3, $f0
/* A0C4 8002ECC4 0C00A720 */  jal       atan2
/* A0C8 8002ECC8 46006386 */   mov.s    $f14, $f12
/* A0CC 8002ECCC E6000094 */  swc1      $f0, 0x94($s0)
/* A0D0 8002ECD0 8FBF0014 */  lw        $ra, 0x14($sp)
/* A0D4 8002ECD4 8FB00010 */  lw        $s0, 0x10($sp)
/* A0D8 8002ECD8 D7BE0040 */  ldc1      $f30, 0x40($sp)
/* A0DC 8002ECDC D7BC0038 */  ldc1      $f28, 0x38($sp)
/* A0E0 8002ECE0 D7BA0030 */  ldc1      $f26, 0x30($sp)
/* A0E4 8002ECE4 D7B80028 */  ldc1      $f24, 0x28($sp)
/* A0E8 8002ECE8 D7B60020 */  ldc1      $f22, 0x20($sp)
/* A0EC 8002ECEC D7B40018 */  ldc1      $f20, 0x18($sp)
/* A0F0 8002ECF0 03E00008 */  jr        $ra
/* A0F4 8002ECF4 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void update_camera_mode_4(Camera* camera) {
    f32 sinBoom;
    f32 cosBoom;
    f32 deltaX;
    f32 deltaY;
    f32 deltaZ;
    f32 deltaX2;
    f32 deltaY2;
    f32 deltaZ2;
    f32 boomYaw;
    f32 boomLength;
    f32 f0;
    f32 f4;
    f32 new_var;

    f0 = camera->targetPos.x;
    deltaX = camera->auxPitch;
    if (f0 > deltaX) {
        f0 = deltaX;
    }
    if (f0 < -deltaX) {
        f0 = -deltaX;
    }
    camera->lookAt_obj_target.x = f0;
    f4 = camera->targetPos.z;
    deltaZ = camera->auxBoomLength;
    if (f4 > deltaZ) {
        f4 = deltaZ;
    }
    if (f4 < -deltaZ) {
        f4 = -deltaZ;
    }
    camera->lookAt_obj_target.z = f4;
    camera->unk_70 = 0.0f;
    camera->currentBoomYaw = 0.0f;
    camera->trueRotation.x = camera->unk_70;
    camera->currentBoomLength = camera->lookAt_dist * D_8009A5EC;
    camera->currentYOffset = camera->auxBoomPitch * D_8009A5EC;
    if (camera->needsInit) {
        camera->needsInit = FALSE;
        camera->unk_98 = 0.0f;
        camera->unk_9C = 0.0f;
        camera->lookAt_obj.x = camera->lookAt_obj_target.x;
        camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset;
        camera->lookAt_obj.z = camera->lookAt_obj_target.z;
        boomYaw = DEG_TO_RAD(camera->currentBoomYaw);
        sinBoom = sin_rad(boomYaw);
        cosBoom = cos_rad(boomYaw);
        deltaX = 0.0f;
        deltaY = 0.0f;
        deltaZ = camera->currentBoomLength;
        deltaX2 = deltaX;
        deltaY2 = deltaY;
        boomYaw = deltaX = -deltaY2;
        deltaZ2 = deltaZ;
        new_var = boomYaw;
        deltaX = deltaX2;
        deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom;
        deltaZ = sinBoom * new_var + deltaZ2 * cosBoom;
        boomYaw = DEG_TO_RAD(camera->unk_70);
        sinBoom = sin_rad(boomYaw);
        cosBoom = cos_rad(boomYaw);
        deltaX2 = cosBoom * deltaX - deltaZ * sinBoom;
        deltaY2 = deltaY;
        deltaZ2 = sinBoom * deltaX + deltaZ * cosBoom;
        camera->lookAt_eye.x = camera->lookAt_obj.x + deltaX2;
        camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2;
        camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2;
    }
    camera->lookAt_obj.x = camera->lookAt_obj_target.x;
    camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset;
    camera->lookAt_obj.z = camera->lookAt_obj_target.z;
    boomYaw = DEG_TO_RAD(camera->currentBoomYaw);
    sinBoom = sin_rad(boomYaw);
    cosBoom = cos_rad(boomYaw);
    deltaX = 0.0f;
    deltaY = 0.0f;
    deltaZ = camera->currentBoomLength;
    deltaX2 = deltaX;
    deltaY2 = deltaY;
    boomYaw = deltaX = -deltaY2;
    deltaZ2 = deltaZ;
    new_var = boomYaw;
    deltaX = deltaX2;
    deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom;
    deltaZ = sinBoom * new_var + deltaZ2 * cosBoom;
    boomYaw = DEG_TO_RAD(camera->unk_70);
    sinBoom = sin_rad(boomYaw);
    cosBoom = cos_rad(boomYaw);
    deltaX2 = cosBoom * deltaX - deltaZ * sinBoom;
    deltaY2 = deltaY;
    deltaZ2 = sinBoom * deltaX + deltaZ * cosBoom;
    camera->lookAt_eye.x = camera->lookAt_obj.x + deltaX2;
    camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2;
    camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2;
    camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z);
    deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x;
    deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y;
    deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z;
    camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ);
    camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ)));
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8024D44C
/* 14078C 8024D44C 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 140790 8024D450 AFB00010 */  sw        $s0, 0x10($sp)
/* 140794 8024D454 0080802D */  daddu     $s0, $a0, $zero
/* 140798 8024D458 3C028027 */  lui       $v0, %hi(gPauseHeldButtons)
/* 14079C 8024D45C 8C4200C0 */  lw        $v0, %lo(gPauseHeldButtons)($v0)
/* 1407A0 8024D460 3C030004 */  lui       $v1, (0x40000 >> 16)
/* 1407A4 8024D464 AFBF0014 */  sw        $ra, 0x14($sp)
/* 1407A8 8024D468 92070003 */  lbu       $a3, 0x3($s0)
/* 1407AC 8024D46C 00431024 */  and       $v0, $v0, $v1
/* 1407B0 8024D470 1040001C */  beqz      $v0, .L8024D4E4
/* 1407B4 8024D474 00000000 */   nop
.L8024D478:
/* 1407B8 8024D478 92020001 */  lbu       $v0, 0x1($s0)
/* 1407BC 8024D47C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1407C0 8024D480 A2020001 */  sb        $v0, 0x1($s0)
/* 1407C4 8024D484 00021600 */  sll       $v0, $v0, 24
/* 1407C8 8024D488 00022E03 */  sra       $a1, $v0, 24
/* 1407CC 8024D48C 04A20015 */  bltzl     $a1, .L8024D4E4
/* 1407D0 8024D490 A2000001 */   sb       $zero, 0x1($s0)
D_8024D494:
/* 1407D4 8024D494 82020004 */  lb        $v0, 0x4($s0)
/* 1407D8 8024D498 82030005 */  lb        $v1, 0x5($s0)
/* 1407DC 8024D49C 00430018 */  mult      $v0, $v1
glabel .L8024D4A0
/* 1407E0 8024D4A0 00003012 */  mflo      $a2
/* 1407E4 8024D4A4 82020006 */  lb        $v0, 0x6($s0)
/* 1407E8 8024D4A8 00000000 */  nop
/* 1407EC 8024D4AC 00C20018 */  mult      $a2, $v0
/* 1407F0 8024D4B0 00002012 */  mflo      $a0
/* 1407F4 8024D4B4 82020002 */  lb        $v0, 0x2($s0)
/* 1407F8 8024D4B8 00000000 */  nop
/* 1407FC 8024D4BC 00620018 */  mult      $v1, $v0
/* 140800 8024D4C0 00001812 */  mflo      $v1
D_8024D4C4:
/* 140804 8024D4C4 00831021 */  addu      $v0, $a0, $v1
/* 140808 8024D4C8 00451021 */  addu      $v0, $v0, $a1
/* 14080C 8024D4CC 8E030008 */  lw        $v1, 0x8($s0)
/* 140810 8024D4D0 92040003 */  lbu       $a0, 0x3($s0)
/* 140814 8024D4D4 00621821 */  addu      $v1, $v1, $v0
/* 140818 8024D4D8 90620000 */  lbu       $v0, 0x0($v1)
/* 14081C 8024D4DC 1082FFE6 */  beq       $a0, $v0, .L8024D478
/* 140820 8024D4E0 00000000 */   nop
.L8024D4E4:
/* 140824 8024D4E4 3C028027 */  lui       $v0, %hi(gPauseHeldButtons)
/* 140828 8024D4E8 8C4200C0 */  lw        $v0, %lo(gPauseHeldButtons)($v0)
glabel .L8024D4EC
/* 14082C 8024D4EC 3C030008 */  lui       $v1, (0x80000 >> 16)
/* 140830 8024D4F0 00431024 */  and       $v0, $v0, $v1
/* 140834 8024D4F4 1040001E */  beqz      $v0, .L8024D570
/* 140838 8024D4F8 00000000 */   nop
/* 14083C 8024D4FC 92060005 */  lbu       $a2, 0x5($s0)
/* 140840 8024D500 82050005 */  lb        $a1, 0x5($s0)
.L8024D504:
/* 140844 8024D504 92020001 */  lbu       $v0, 0x1($s0)
/* 140848 8024D508 24420001 */  addiu     $v0, $v0, 0x1
/* 14084C 8024D50C A2020001 */  sb        $v0, 0x1($s0)
/* 140850 8024D510 00021600 */  sll       $v0, $v0, 24
/* 140854 8024D514 00022603 */  sra       $a0, $v0, 24
/* 140858 8024D518 0085102A */  slt       $v0, $a0, $a1
/* 14085C 8024D51C 1040001F */  beqz      $v0, .L8024D59C
/* 140860 8024D520 24C2FFFF */   addiu    $v0, $a2, -0x1
/* 140864 8024D524 82020004 */  lb        $v0, 0x4($s0)
/* 140868 8024D528 00450018 */  mult      $v0, $a1
/* 14086C 8024D52C 00001812 */  mflo      $v1
/* 140870 8024D530 82020006 */  lb        $v0, 0x6($s0)
/* 140874 8024D534 00000000 */  nop
D_8024D538_C0ADB8:
/* 140878 8024D538 00620018 */  mult      $v1, $v0
/* 14087C 8024D53C 00001812 */  mflo      $v1
/* 140880 8024D540 82020002 */  lb        $v0, 0x2($s0)
/* 140884 8024D544 00000000 */  nop
glabel .L8024D548
/* 140888 8024D548 00A20018 */  mult      $a1, $v0
/* 14088C 8024D54C 00004812 */  mflo      $t1
/* 140890 8024D550 00691021 */  addu      $v0, $v1, $t1
/* 140894 8024D554 00441021 */  addu      $v0, $v0, $a0
/* 140898 8024D558 8E030008 */  lw        $v1, 0x8($s0)
/* 14089C 8024D55C 92040003 */  lbu       $a0, 0x3($s0)
/* 1408A0 8024D560 00621821 */  addu      $v1, $v1, $v0
/* 1408A4 8024D564 90620000 */  lbu       $v0, 0x0($v1)
/* 1408A8 8024D568 1082FFE6 */  beq       $a0, $v0, .L8024D504
/* 1408AC 8024D56C 00000000 */   nop
.L8024D570:
/* 1408B0 8024D570 3C028027 */  lui       $v0, %hi(gPauseHeldButtons)
/* 1408B4 8024D574 8C4200C0 */  lw        $v0, %lo(gPauseHeldButtons)($v0)
/* 1408B8 8024D578 3C030001 */  lui       $v1, (0x10000 >> 16)
/* 1408BC 8024D57C 00431024 */  and       $v0, $v0, $v1
D_8024D580_C0AE00:
/* 1408C0 8024D580 10400029 */  beqz      $v0, .L8024D628
/* 1408C4 8024D584 24020002 */   addiu    $v0, $zero, 0x2
/* 1408C8 8024D588 92030003 */  lbu       $v1, 0x3($s0)
/* 1408CC 8024D58C 14620005 */  bne       $v1, $v0, .L8024D5A4
/* 1408D0 8024D590 24020005 */   addiu    $v0, $zero, 0x5
/* 1408D4 8024D594 0809356B */  j         .L8024D5AC
/* 1408D8 8024D598 24020003 */   addiu    $v0, $zero, 0x3
.L8024D59C:
/* 1408DC 8024D59C 0809355C */  j         .L8024D570
glabel .L8024D5A0
/* 1408E0 8024D5A0 A2020001 */   sb       $v0, 0x1($s0)
.L8024D5A4:
/* 1408E4 8024D5A4 14620004 */  bne       $v1, $v0, .L8024D5B8
/* 1408E8 8024D5A8 24020001 */   addiu    $v0, $zero, 0x1
.L8024D5AC:
/* 1408EC 8024D5AC A2020001 */  sb        $v0, 0x1($s0)
/* 1408F0 8024D5B0 0809358A */  j         .L8024D628
/* 1408F4 8024D5B4 A2000002 */   sb       $zero, 0x2($s0)
.L8024D5B8:
/* 1408F8 8024D5B8 92020002 */  lbu       $v0, 0x2($s0)
/* 1408FC 8024D5BC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 140900 8024D5C0 A2020002 */  sb        $v0, 0x2($s0)
/* 140904 8024D5C4 00021600 */  sll       $v0, $v0, 24
/* 140908 8024D5C8 00022603 */  sra       $a0, $v0, 24
/* 14090C 8024D5CC 04820016 */  bltzl     $a0, .L8024D628
/* 140910 8024D5D0 A2000002 */   sb       $zero, 0x2($s0)
/* 140914 8024D5D4 82020004 */  lb        $v0, 0x4($s0)
/* 140918 8024D5D8 82030005 */  lb        $v1, 0x5($s0)
/* 14091C 8024D5DC 00430018 */  mult      $v0, $v1
/* 140920 8024D5E0 00002812 */  mflo      $a1
glabel .L8024D5E4
/* 140924 8024D5E4 82020006 */  lb        $v0, 0x6($s0)
/* 140928 8024D5E8 00000000 */  nop
/* 14092C 8024D5EC 00A20018 */  mult      $a1, $v0
/* 140930 8024D5F0 00001012 */  mflo      $v0
/* 140934 8024D5F4 00000000 */  nop
/* 140938 8024D5F8 00000000 */  nop
/* 14093C 8024D5FC 00640018 */  mult      $v1, $a0
/* 140940 8024D600 82040001 */  lb        $a0, 0x1($s0)
/* 140944 8024D604 00001812 */  mflo      $v1
D_8024D608_C0AE88:
/* 140948 8024D608 00431021 */  addu      $v0, $v0, $v1
/* 14094C 8024D60C 00441021 */  addu      $v0, $v0, $a0
/* 140950 8024D610 8E030008 */  lw        $v1, 0x8($s0)
/* 140954 8024D614 92040003 */  lbu       $a0, 0x3($s0)
/* 140958 8024D618 00621821 */  addu      $v1, $v1, $v0
/* 14095C 8024D61C 90620000 */  lbu       $v0, 0x0($v1)
/* 140960 8024D620 1082FFE5 */  beq       $a0, $v0, .L8024D5B8
/* 140964 8024D624 00000000 */   nop
.L8024D628:
/* 140968 8024D628 3C028027 */  lui       $v0, %hi(gPauseHeldButtons)
/* 14096C 8024D62C 8C4200C0 */  lw        $v0, %lo(gPauseHeldButtons)($v0)
/* 140970 8024D630 3C030002 */  lui       $v1, (0x20000 >> 16)
/* 140974 8024D634 00431024 */  and       $v0, $v0, $v1
/* 140978 8024D638 1040002F */  beqz      $v0, .L8024D6F8
/* 14097C 8024D63C 24020002 */   addiu    $v0, $zero, 0x2
/* 140980 8024D640 92030003 */  lbu       $v1, 0x3($s0)
/* 140984 8024D644 14620006 */  bne       $v1, $v0, .L8024D660
/* 140988 8024D648 24020005 */   addiu    $v0, $zero, 0x5
/* 14098C 8024D64C 24020003 */  addiu     $v0, $zero, 0x3
/* 140990 8024D650 A2020001 */  sb        $v0, 0x1($s0)
glabel .L8024D654
/* 140994 8024D654 24020001 */  addiu     $v0, $zero, 0x1
/* 140998 8024D658 080935BE */  j         .L8024D6F8
/* 14099C 8024D65C A2020002 */   sb       $v0, 0x2($s0)
.L8024D660:
/* 1409A0 8024D660 14620006 */  bne       $v1, $v0, .L8024D67C
/* 1409A4 8024D664 24020001 */   addiu    $v0, $zero, 0x1
/* 1409A8 8024D668 A2020001 */  sb        $v0, 0x1($s0)
/* 1409AC 8024D66C 080935BE */  j         .L8024D6F8
/* 1409B0 8024D670 A2020002 */   sb       $v0, 0x2($s0)
.L8024D674:
/* 1409B4 8024D674 080935BE */  j         .L8024D6F8
/* 1409B8 8024D678 A2020002 */   sb       $v0, 0x2($s0)
.L8024D67C:
/* 1409BC 8024D67C 92060006 */  lbu       $a2, 0x6($s0)
D_8024D680_C0AF00:
/* 1409C0 8024D680 82050006 */  lb        $a1, 0x6($s0)
.L8024D684:
/* 1409C4 8024D684 92020002 */  lbu       $v0, 0x2($s0)
/* 1409C8 8024D688 24420001 */  addiu     $v0, $v0, 0x1
/* 1409CC 8024D68C A2020002 */  sb        $v0, 0x2($s0)
/* 1409D0 8024D690 00021600 */  sll       $v0, $v0, 24
/* 1409D4 8024D694 00022603 */  sra       $a0, $v0, 24
/* 1409D8 8024D698 0085102A */  slt       $v0, $a0, $a1
/* 1409DC 8024D69C 1040FFF5 */  beqz      $v0, .L8024D674
glabel .L8024D6A0
/* 1409E0 8024D6A0 24C2FFFF */   addiu    $v0, $a2, -0x1
/* 1409E4 8024D6A4 82020004 */  lb        $v0, 0x4($s0)
/* 1409E8 8024D6A8 82030005 */  lb        $v1, 0x5($s0)
/* 1409EC 8024D6AC 00430018 */  mult      $v0, $v1
/* 1409F0 8024D6B0 00004812 */  mflo      $t1
D_8024D6B4:
/* 1409F4 8024D6B4 00000000 */  nop
/* 1409F8 8024D6B8 00000000 */  nop
/* 1409FC 8024D6BC 01250018 */  mult      $t1, $a1
/* 140A00 8024D6C0 00001012 */  mflo      $v0
/* 140A04 8024D6C4 00000000 */  nop
/* 140A08 8024D6C8 00000000 */  nop
/* 140A0C 8024D6CC 00640018 */  mult      $v1, $a0
/* 140A10 8024D6D0 82040001 */  lb        $a0, 0x1($s0)
glabel .L8024D6D4
/* 140A14 8024D6D4 00001812 */  mflo      $v1
/* 140A18 8024D6D8 00431021 */  addu      $v0, $v0, $v1
/* 140A1C 8024D6DC 00441021 */  addu      $v0, $v0, $a0
/* 140A20 8024D6E0 8E030008 */  lw        $v1, 0x8($s0)
/* 140A24 8024D6E4 92040003 */  lbu       $a0, 0x3($s0)
/* 140A28 8024D6E8 00621821 */  addu      $v1, $v1, $v0
/* 140A2C 8024D6EC 90620000 */  lbu       $v0, 0x0($v1)
/* 140A30 8024D6F0 1082FFE4 */  beq       $a0, $v0, .L8024D684
/* 140A34 8024D6F4 00000000 */   nop
.L8024D6F8:
/* 140A38 8024D6F8 82020004 */  lb        $v0, 0x4($s0)
/* 140A3C 8024D6FC 82030005 */  lb        $v1, 0x5($s0)
D_8024D700_C0AF80:
/* 140A40 8024D700 00430018 */  mult      $v0, $v1
/* 140A44 8024D704 00002812 */  mflo      $a1
/* 140A48 8024D708 82020006 */  lb        $v0, 0x6($s0)
/* 140A4C 8024D70C 00000000 */  nop
/* 140A50 8024D710 00A20018 */  mult      $a1, $v0
/* 140A54 8024D714 00002012 */  mflo      $a0
.L8024D718:
/* 140A58 8024D718 82020002 */  lb        $v0, 0x2($s0)
/* 140A5C 8024D71C 00000000 */  nop
D_8024D720:
/* 140A60 8024D720 00620018 */  mult      $v1, $v0
/* 140A64 8024D724 00001812 */  mflo      $v1
/* 140A68 8024D728 00831821 */  addu      $v1, $a0, $v1
/* 140A6C 8024D72C 82040001 */  lb        $a0, 0x1($s0)
/* 140A70 8024D730 8E020008 */  lw        $v0, 0x8($s0)
/* 140A74 8024D734 00641821 */  addu      $v1, $v1, $a0
/* 140A78 8024D738 00431021 */  addu      $v0, $v0, $v1
/* 140A7C 8024D73C 90420000 */  lbu       $v0, 0x0($v0)
glabel .L8024D740
/* 140A80 8024D740 24030004 */  addiu     $v1, $zero, 0x4
/* 140A84 8024D744 A2020003 */  sb        $v0, 0x3($s0)
/* 140A88 8024D748 304200FF */  andi      $v0, $v0, 0xFF
/* 140A8C 8024D74C 14430003 */  bne       $v0, $v1, .L8024D75C
/* 140A90 8024D750 24020001 */   addiu    $v0, $zero, 0x1
/* 140A94 8024D754 A2020001 */  sb        $v0, 0x1($s0)
/* 140A98 8024D758 A2020002 */  sb        $v0, 0x2($s0)
.L8024D75C:
/* 140A9C 8024D75C 92020003 */  lbu       $v0, 0x3($s0)
/* 140AA0 8024D760 10470003 */  beq       $v0, $a3, .L8024D770
/* 140AA4 8024D764 00000000 */   nop
/* 140AA8 8024D768 0C05272D */  jal       sfx_play_sound
/* 140AAC 8024D76C 240400C7 */   addiu    $a0, $zero, 0xC7
.L8024D770:
/* 140AB0 8024D770 3C028027 */  lui       $v0, %hi(gPausePressedButtons)
/* 140AB4 8024D774 8C4200C4 */  lw        $v0, %lo(gPausePressedButtons)($v0)
/* 140AB8 8024D778 30424000 */  andi      $v0, $v0, 0x4000
/* 140ABC 8024D77C 10400007 */  beqz      $v0, .L8024D79C
/* 140AC0 8024D780 00000000 */   nop
/* 140AC4 8024D784 3C018027 */  lui       $at, %hi(gPauseMenuCurrentTab)
D_8024D788_C0B008:
/* 140AC8 8024D788 A02000D4 */  sb        $zero, %lo(gPauseMenuCurrentTab)($at)
/* 140ACC 8024D78C 0C05272D */  jal       sfx_play_sound
D_8024D790:
/* 140AD0 8024D790 240400CA */   addiu    $a0, $zero, 0xCA
/* 140AD4 8024D794 080935FC */  j         .L8024D7F0
/* 140AD8 8024D798 00000000 */   nop
.L8024D79C:
/* 140ADC 8024D79C 3C018027 */  lui       $at, %hi(gPauseCurrentDescIconScript)
glabel .L8024D7A0
/* 140AE0 8024D7A0 AC2000CC */  sw        $zero, %lo(gPauseCurrentDescIconScript)($at)
/* 140AE4 8024D7A4 0C039D59 */  jal       get_player_data
/* 140AE8 8024D7A8 00000000 */   nop
/* 140AEC 8024D7AC 92030003 */  lbu       $v1, 0x3($s0)
/* 140AF0 8024D7B0 8042028E */  lb        $v0, 0x28E($v0)
D_8024D7B4:
/* 140AF4 8024D7B4 00031880 */  sll       $v1, $v1, 2
/* 140AF8 8024D7B8 3C018027 */  lui       $at, %hi(gPauseSpiritsIndexes)
/* 140AFC 8024D7BC 00230821 */  addu      $at, $at, $v1
/* 140B00 8024D7C0 8C2306E0 */  lw        $v1, %lo(gPauseSpiritsIndexes)($at)
/* 140B04 8024D7C4 0062102A */  slt       $v0, $v1, $v0
/* 140B08 8024D7C8 14400005 */  bnez      $v0, .L8024D7E0
/* 140B0C 8024D7CC 3C02001D */   lui      $v0, (0x1D0031 >> 16)
/* 140B10 8024D7D0 0C093BA0 */  jal       func_8024EE80
/* 140B14 8024D7D4 24040056 */   addiu    $a0, $zero, 0x56
/* 140B18 8024D7D8 080935FA */  j         .L8024D7E8
/* 140B1C 8024D7DC 00000000 */   nop
.L8024D7E0:
/* 140B20 8024D7E0 34420031 */  ori       $v0, $v0, (0x1D0031 & 0xFFFF)
/* 140B24 8024D7E4 00621021 */  addu      $v0, $v1, $v0
.L8024D7E8:
/* 140B28 8024D7E8 3C018027 */  lui       $at, %hi(gPauseCurrentDescMsg)
.L8024D7EC:
/* 140B2C 8024D7EC AC2200C8 */  sw        $v0, %lo(gPauseCurrentDescMsg)($at)
.L8024D7F0:
/* 140B30 8024D7F0 8FBF0014 */  lw        $ra, 0x14($sp)
/* 140B34 8024D7F4 8FB00010 */  lw        $s0, 0x10($sp)
/* 140B38 8024D7F8 03E00008 */  jr        $ra
glabel .L8024D7FC
/* 140B3C 8024D7FC 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void pause_spirits_handle_input(MenuPanel* panel) {
    s32 oldSelected = panel->selected;

    if (gPauseHeldButtons & BUTTON_STICK_LEFT) {
        while (TRUE) {
            panel->col--;
            if (panel->col < 0) {
                panel->col = 0;
                break;
            }

            if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
                break;
            }
        }
    }

    if (gPauseHeldButtons & BUTTON_STICK_RIGHT) {
        while (TRUE) {
            panel->col++;
            if (panel->col >= panel->numCols) {
                panel->col = panel->numCols - 1;
                break;
            }

            if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
                break;
            }
        }
    }

    if (gPauseHeldButtons & BUTTON_STICK_UP) {
        if (panel->selected == 2) {
            panel->col = 3;
            panel->row = 0;
        } else if (panel->selected == 5) {
            panel->col = 1;
            panel->row = 0;
        } else {
            while (TRUE) {
                panel->row--;
                if (panel->row < 0) {
                    panel->row = 0;
                    break;
                }
                if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
                    break;
                }
            }
        }
    }

    if (gPauseHeldButtons & BUTTON_STICK_DOWN) {
        if (panel->selected == 2) {
            panel->col = 3;
            panel->row = 1;
        } else if (panel->selected == 5) {
            panel->col = 1;
            panel->row = 1;
        } else {
            while (TRUE) {
                panel->row++;
                if (panel->row >= panel->numRows) {
                    panel->row = panel->numRows - 1;
                    break;
                }
                if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
                    break;
                }
            }
        }
    }

    panel->selected = MENU_PANEL_SELECTED_GRID_DATA(panel);

    if (panel->selected == 4) {
        panel->col = 1;
        panel->row = 1;
    }

    if (panel->selected != oldSelected) {
        sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
    }

    if (gPausePressedButtons & BUTTON_B) {
        gPauseMenuCurrentTab = 0;
        sfx_play_sound(SOUND_MENU_BACK);
        return;
    }

    gPauseCurrentDescIconScript = 0;

    if (get_player_data()->maxStarPower <= gPauseSpiritsIndexes[panel->selected]) {
        gPauseCurrentDescMsg = pause_get_menu_msg(PAUSE_MSG_UNKNOWN_SPIRIT);
    } else {
        gPauseCurrentDescMsg = MSG_Menus_SpiritDesc_Eldstar + gPauseSpiritsIndexes[panel->selected];
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_draw_palswap_mode_1
/* 169B4 8003B5B4 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 169B8 8003B5B8 AFB00018 */  sw        $s0, 0x18($sp)
/* 169BC 8003B5BC 0080802D */  daddu     $s0, $a0, $zero
/* 169C0 8003B5C0 AFB20020 */  sw        $s2, 0x20($sp)
/* 169C4 8003B5C4 00A0902D */  daddu     $s2, $a1, $zero
/* 169C8 8003B5C8 AFBF0024 */  sw        $ra, 0x24($sp)
/* 169CC 8003B5CC AFB1001C */  sw        $s1, 0x1C($sp)
/* 169D0 8003B5D0 820200B6 */  lb        $v0, 0xB6($s0)
/* 169D4 8003B5D4 10400034 */  beqz      $v0, .L8003B6A8
/* 169D8 8003B5D8 00C0882D */   daddu    $s1, $a2, $zero
/* 169DC 8003B5DC 96040028 */  lhu       $a0, 0x28($s0)
/* 169E0 8003B5E0 0C0B7A90 */  jal       spr_get_npc_palettes
/* 169E4 8003B5E4 00000000 */   nop
/* 169E8 8003B5E8 AE0200C4 */  sw        $v0, 0xC4($s0)
/* 169EC 8003B5EC 0040202D */  daddu     $a0, $v0, $zero
/* 169F0 8003B5F0 A20000C1 */  sb        $zero, 0xC1($s0)
/* 169F4 8003B5F4 8C830000 */  lw        $v1, 0x0($a0)
/* 169F8 8003B5F8 2402FFFF */  addiu     $v0, $zero, -0x1
/* 169FC 8003B5FC 1062000B */  beq       $v1, $v0, .L8003B62C
/* 16A00 8003B600 0080182D */   daddu    $v1, $a0, $zero
/* 16A04 8003B604 0040202D */  daddu     $a0, $v0, $zero
.L8003B608:
/* 16A08 8003B608 920200C1 */  lbu       $v0, 0xC1($s0)
/* 16A0C 8003B60C 24420001 */  addiu     $v0, $v0, 0x1
/* 16A10 8003B610 A20200C1 */  sb        $v0, 0xC1($s0)
/* 16A14 8003B614 00021600 */  sll       $v0, $v0, 24
/* 16A18 8003B618 00021583 */  sra       $v0, $v0, 22
/* 16A1C 8003B61C 00431021 */  addu      $v0, $v0, $v1
/* 16A20 8003B620 8C420000 */  lw        $v0, 0x0($v0)
/* 16A24 8003B624 1444FFF8 */  bne       $v0, $a0, .L8003B608
/* 16A28 8003B628 00000000 */   nop
.L8003B62C:
/* 16A2C 8003B62C 0C0B7A9B */  jal       spr_get_npc_color_variations
/* 16A30 8003B630 96040028 */   lhu      $a0, 0x28($s0)
/* 16A34 8003B634 820300C1 */  lb        $v1, 0xC1($s0)
/* 16A38 8003B638 0000302D */  daddu     $a2, $zero, $zero
/* 16A3C 8003B63C 18600015 */  blez      $v1, .L8003B694
/* 16A40 8003B640 A20200C0 */   sb       $v0, 0xC0($s0)
/* 16A44 8003B644 240700C8 */  addiu     $a3, $zero, 0xC8
.L8003B648:
/* 16A48 8003B648 8E0300C4 */  lw        $v1, 0xC4($s0)
/* 16A4C 8003B64C 00061080 */  sll       $v0, $a2, 2
/* 16A50 8003B650 00431021 */  addu      $v0, $v0, $v1
/* 16A54 8003B654 8C430000 */  lw        $v1, 0x0($v0)
/* 16A58 8003B658 10600009 */  beqz      $v1, .L8003B680
/* 16A5C 8003B65C 02072821 */   addu     $a1, $s0, $a3
/* 16A60 8003B660 0000202D */  daddu     $a0, $zero, $zero
.L8003B664:
/* 16A64 8003B664 94620000 */  lhu       $v0, 0x0($v1)
/* 16A68 8003B668 24630002 */  addiu     $v1, $v1, 0x2
/* 16A6C 8003B66C 24840001 */  addiu     $a0, $a0, 0x1
/* 16A70 8003B670 A4A20000 */  sh        $v0, 0x0($a1)
/* 16A74 8003B674 28820010 */  slti      $v0, $a0, 0x10
/* 16A78 8003B678 1440FFFA */  bnez      $v0, .L8003B664
/* 16A7C 8003B67C 24A50002 */   addiu    $a1, $a1, 0x2
.L8003B680:
/* 16A80 8003B680 820200C1 */  lb        $v0, 0xC1($s0)
/* 16A84 8003B684 24C60001 */  addiu     $a2, $a2, 0x1
/* 16A88 8003B688 00C2102A */  slt       $v0, $a2, $v0
/* 16A8C 8003B68C 1440FFEE */  bnez      $v0, .L8003B648
/* 16A90 8003B690 24E70020 */   addiu    $a3, $a3, 0x20
.L8003B694:
/* 16A94 8003B694 2402FFFE */  addiu     $v0, $zero, -0x2
/* 16A98 8003B698 A20200B7 */  sb        $v0, 0xB7($s0)
/* 16A9C 8003B69C A60000BE */  sh        $zero, 0xBE($s0)
/* 16AA0 8003B6A0 A20000B6 */  sb        $zero, 0xB6($s0)
/* 16AA4 8003B6A4 A60000BC */  sh        $zero, 0xBC($s0)
.L8003B6A8:
/* 16AA8 8003B6A8 860200BC */  lh        $v0, 0xBC($s0)
/* 16AAC 8003B6AC 14400013 */  bnez      $v0, .L8003B6FC
/* 16AB0 8003B6B0 00000000 */   nop
/* 16AB4 8003B6B4 920200B7 */  lbu       $v0, 0xB7($s0)
/* 16AB8 8003B6B8 3C038007 */  lui       $v1, %hi(D_80077BF0)
/* 16ABC 8003B6BC 24637BF0 */  addiu     $v1, $v1, %lo(D_80077BF0)
/* 16AC0 8003B6C0 24420002 */  addiu     $v0, $v0, 0x2
/* 16AC4 8003B6C4 A20200B7 */  sb        $v0, 0xB7($s0)
/* 16AC8 8003B6C8 00021600 */  sll       $v0, $v0, 24
/* 16ACC 8003B6CC 00021603 */  sra       $v0, $v0, 24
/* 16AD0 8003B6D0 3C048007 */  lui       $a0, %hi(D_80077BF0)
/* 16AD4 8003B6D4 00822021 */  addu      $a0, $a0, $v0
/* 16AD8 8003B6D8 90847BF0 */  lbu       $a0, %lo(D_80077BF0)($a0)
/* 16ADC 8003B6DC 240200FF */  addiu     $v0, $zero, 0xFF
/* 16AE0 8003B6E0 50820001 */  beql      $a0, $v0, .L8003B6E8
/* 16AE4 8003B6E4 A20000B7 */   sb       $zero, 0xB7($s0)
.L8003B6E8:
/* 16AE8 8003B6E8 820200B7 */  lb        $v0, 0xB7($s0)
/* 16AEC 8003B6EC 00431021 */  addu      $v0, $v0, $v1
/* 16AF0 8003B6F0 90420001 */  lbu       $v0, 0x1($v0)
/* 16AF4 8003B6F4 00021042 */  srl       $v0, $v0, 1
/* 16AF8 8003B6F8 A60200BC */  sh        $v0, 0xBC($s0)
.L8003B6FC:
/* 16AFC 8003B6FC 960300BC */  lhu       $v1, 0xBC($s0)
/* 16B00 8003B700 820200B7 */  lb        $v0, 0xB7($s0)
/* 16B04 8003B704 2463FFFF */  addiu     $v1, $v1, -0x1
/* 16B08 8003B708 3C048007 */  lui       $a0, %hi(D_80077BF0)
/* 16B0C 8003B70C 00822021 */  addu      $a0, $a0, $v0
/* 16B10 8003B710 90847BF0 */  lbu       $a0, %lo(D_80077BF0)($a0)
/* 16B14 8003B714 24020001 */  addiu     $v0, $zero, 0x1
/* 16B18 8003B718 10820025 */  beq       $a0, $v0, .L8003B7B0
/* 16B1C 8003B71C A60300BC */   sh       $v1, 0xBC($s0)
/* 16B20 8003B720 28820002 */  slti      $v0, $a0, 0x2
/* 16B24 8003B724 10400005 */  beqz      $v0, .L8003B73C
/* 16B28 8003B728 24020002 */   addiu    $v0, $zero, 0x2
/* 16B2C 8003B72C 10800007 */  beqz      $a0, .L8003B74C
/* 16B30 8003B730 00000000 */   nop
/* 16B34 8003B734 0800EE2B */  j         .L8003B8AC
/* 16B38 8003B738 00000000 */   nop
.L8003B73C:
/* 16B3C 8003B73C 1082003C */  beq       $a0, $v0, .L8003B830
/* 16B40 8003B740 00000000 */   nop
/* 16B44 8003B744 0800EE2B */  j         .L8003B8AC
/* 16B48 8003B748 00000000 */   nop
.L8003B74C:
/* 16B4C 8003B74C 820200C0 */  lb        $v0, 0xC0($s0)
/* 16B50 8003B750 18400056 */  blez      $v0, .L8003B8AC
/* 16B54 8003B754 0000302D */   daddu    $a2, $zero, $zero
/* 16B58 8003B758 240700C8 */  addiu     $a3, $zero, 0xC8
.L8003B75C:
/* 16B5C 8003B75C 8E0300C4 */  lw        $v1, 0xC4($s0)
/* 16B60 8003B760 00061080 */  sll       $v0, $a2, 2
/* 16B64 8003B764 00431021 */  addu      $v0, $v0, $v1
/* 16B68 8003B768 8C430000 */  lw        $v1, 0x0($v0)
/* 16B6C 8003B76C 10600009 */  beqz      $v1, .L8003B794
/* 16B70 8003B770 02072821 */   addu     $a1, $s0, $a3
/* 16B74 8003B774 0000202D */  daddu     $a0, $zero, $zero
.L8003B778:
/* 16B78 8003B778 94620000 */  lhu       $v0, 0x0($v1)
/* 16B7C 8003B77C 24630002 */  addiu     $v1, $v1, 0x2
/* 16B80 8003B780 24840001 */  addiu     $a0, $a0, 0x1
/* 16B84 8003B784 A4A20000 */  sh        $v0, 0x0($a1)
/* 16B88 8003B788 28820010 */  slti      $v0, $a0, 0x10
/* 16B8C 8003B78C 1440FFFA */  bnez      $v0, .L8003B778
/* 16B90 8003B790 24A50002 */   addiu    $a1, $a1, 0x2
.L8003B794:
/* 16B94 8003B794 820200C0 */  lb        $v0, 0xC0($s0)
/* 16B98 8003B798 24C60001 */  addiu     $a2, $a2, 0x1
/* 16B9C 8003B79C 00C2102A */  slt       $v0, $a2, $v0
/* 16BA0 8003B7A0 1440FFEE */  bnez      $v0, .L8003B75C
/* 16BA4 8003B7A4 24E70020 */   addiu    $a3, $a3, 0x20
/* 16BA8 8003B7A8 0800EE2B */  j         .L8003B8AC
/* 16BAC 8003B7AC 00000000 */   nop
.L8003B7B0:
/* 16BB0 8003B7B0 820200C0 */  lb        $v0, 0xC0($s0)
/* 16BB4 8003B7B4 920300C0 */  lbu       $v1, 0xC0($s0)
/* 16BB8 8003B7B8 1840003C */  blez      $v0, .L8003B8AC
/* 16BBC 8003B7BC 0000302D */   daddu    $a2, $zero, $zero
/* 16BC0 8003B7C0 240700C8 */  addiu     $a3, $zero, 0xC8
.L8003B7C4:
/* 16BC4 8003B7C4 00031600 */  sll       $v0, $v1, 24
/* 16BC8 8003B7C8 00021603 */  sra       $v0, $v0, 24
/* 16BCC 8003B7CC 00021880 */  sll       $v1, $v0, 2
/* 16BD0 8003B7D0 00621821 */  addu      $v1, $v1, $v0
/* 16BD4 8003B7D4 00661821 */  addu      $v1, $v1, $a2
/* 16BD8 8003B7D8 8E0200C4 */  lw        $v0, 0xC4($s0)
/* 16BDC 8003B7DC 00031880 */  sll       $v1, $v1, 2
/* 16BE0 8003B7E0 00621821 */  addu      $v1, $v1, $v0
/* 16BE4 8003B7E4 8C630000 */  lw        $v1, 0x0($v1)
/* 16BE8 8003B7E8 10600009 */  beqz      $v1, .L8003B810
/* 16BEC 8003B7EC 02072821 */   addu     $a1, $s0, $a3
/* 16BF0 8003B7F0 0000202D */  daddu     $a0, $zero, $zero
.L8003B7F4:
/* 16BF4 8003B7F4 94620000 */  lhu       $v0, 0x0($v1)
/* 16BF8 8003B7F8 24630002 */  addiu     $v1, $v1, 0x2
/* 16BFC 8003B7FC 24840001 */  addiu     $a0, $a0, 0x1
/* 16C00 8003B800 A4A20000 */  sh        $v0, 0x0($a1)
/* 16C04 8003B804 28820010 */  slti      $v0, $a0, 0x10
/* 16C08 8003B808 1440FFFA */  bnez      $v0, .L8003B7F4
/* 16C0C 8003B80C 24A50002 */   addiu    $a1, $a1, 0x2
.L8003B810:
/* 16C10 8003B810 24C60001 */  addiu     $a2, $a2, 0x1
/* 16C14 8003B814 820200C0 */  lb        $v0, 0xC0($s0)
/* 16C18 8003B818 920300C0 */  lbu       $v1, 0xC0($s0)
/* 16C1C 8003B81C 00C2102A */  slt       $v0, $a2, $v0
/* 16C20 8003B820 1440FFE8 */  bnez      $v0, .L8003B7C4
/* 16C24 8003B824 24E70020 */   addiu    $a3, $a3, 0x20
/* 16C28 8003B828 0800EE2B */  j         .L8003B8AC
/* 16C2C 8003B82C 00000000 */   nop
.L8003B830:
/* 16C30 8003B830 820200C0 */  lb        $v0, 0xC0($s0)
/* 16C34 8003B834 920300C0 */  lbu       $v1, 0xC0($s0)
/* 16C38 8003B838 1840001C */  blez      $v0, .L8003B8AC
/* 16C3C 8003B83C 0000302D */   daddu    $a2, $zero, $zero
/* 16C40 8003B840 240700C8 */  addiu     $a3, $zero, 0xC8
.L8003B844:
/* 16C44 8003B844 00031600 */  sll       $v0, $v1, 24
/* 16C48 8003B848 00021603 */  sra       $v0, $v0, 24
/* 16C4C 8003B84C 00021840 */  sll       $v1, $v0, 1
/* 16C50 8003B850 00621821 */  addu      $v1, $v1, $v0
/* 16C54 8003B854 00031840 */  sll       $v1, $v1, 1
/* 16C58 8003B858 00661821 */  addu      $v1, $v1, $a2
/* 16C5C 8003B85C 8E0200C4 */  lw        $v0, 0xC4($s0)
/* 16C60 8003B860 00031880 */  sll       $v1, $v1, 2
/* 16C64 8003B864 00621821 */  addu      $v1, $v1, $v0
/* 16C68 8003B868 8C630000 */  lw        $v1, 0x0($v1)
/* 16C6C 8003B86C 10600009 */  beqz      $v1, .L8003B894
/* 16C70 8003B870 02072821 */   addu     $a1, $s0, $a3
/* 16C74 8003B874 0000202D */  daddu     $a0, $zero, $zero
.L8003B878:
/* 16C78 8003B878 94620000 */  lhu       $v0, 0x0($v1)
/* 16C7C 8003B87C 24630002 */  addiu     $v1, $v1, 0x2
/* 16C80 8003B880 24840001 */  addiu     $a0, $a0, 0x1
/* 16C84 8003B884 A4A20000 */  sh        $v0, 0x0($a1)
/* 16C88 8003B888 28820010 */  slti      $v0, $a0, 0x10
/* 16C8C 8003B88C 1440FFFA */  bnez      $v0, .L8003B878
/* 16C90 8003B890 24A50002 */   addiu    $a1, $a1, 0x2
.L8003B894:
/* 16C94 8003B894 24C60001 */  addiu     $a2, $a2, 0x1
/* 16C98 8003B898 820200C0 */  lb        $v0, 0xC0($s0)
/* 16C9C 8003B89C 920300C0 */  lbu       $v1, 0xC0($s0)
/* 16CA0 8003B8A0 00C2102A */  slt       $v0, $a2, $v0
/* 16CA4 8003B8A4 1440FFE7 */  bnez      $v0, .L8003B844
/* 16CA8 8003B8A8 24E70020 */   addiu    $a3, $a3, 0x20
.L8003B8AC:
/* 16CAC 8003B8AC 820200C1 */  lb        $v0, 0xC1($s0)
/* 16CB0 8003B8B0 1840000B */  blez      $v0, .L8003B8E0
/* 16CB4 8003B8B4 0000302D */   daddu    $a2, $zero, $zero
/* 16CB8 8003B8B8 240400C8 */  addiu     $a0, $zero, 0xC8
/* 16CBC 8003B8BC 0200182D */  daddu     $v1, $s0, $zero
.L8003B8C0:
/* 16CC0 8003B8C0 02041021 */  addu      $v0, $s0, $a0
/* 16CC4 8003B8C4 24840020 */  addiu     $a0, $a0, 0x20
/* 16CC8 8003B8C8 AC6202C8 */  sw        $v0, 0x2C8($v1)
/* 16CCC 8003B8CC 820200C1 */  lb        $v0, 0xC1($s0)
/* 16CD0 8003B8D0 24C60001 */  addiu     $a2, $a2, 0x1
/* 16CD4 8003B8D4 00C2102A */  slt       $v0, $a2, $v0
/* 16CD8 8003B8D8 1440FFF9 */  bnez      $v0, .L8003B8C0
/* 16CDC 8003B8DC 24630004 */   addiu    $v1, $v1, 0x4
.L8003B8E0:
/* 16CE0 8003B8E0 8E020000 */  lw        $v0, 0x0($s0)
/* 16CE4 8003B8E4 3C034000 */  lui       $v1, (0x40000000 >> 16)
/* 16CE8 8003B8E8 00431024 */  and       $v0, $v0, $v1
/* 16CEC 8003B8EC 14400016 */  bnez      $v0, .L8003B948
/* 16CF0 8003B8F0 0240282D */   daddu    $a1, $s2, $zero
/* 16CF4 8003B8F4 920200AC */  lbu       $v0, 0xAC($s0)
/* 16CF8 8003B8F8 920300AD */  lbu       $v1, 0xAD($s0)
/* 16CFC 8003B8FC 00430018 */  mult      $v0, $v1
/* 16D00 8003B900 00001012 */  mflo      $v0
/* 16D04 8003B904 3C038080 */  lui       $v1, (0x80808081 >> 16)
/* 16D08 8003B908 34638081 */  ori       $v1, $v1, (0x80808081 & 0xFFFF)
/* 16D0C 8003B90C 00430018 */  mult      $v0, $v1
/* 16D10 8003B910 8E030024 */  lw        $v1, 0x24($s0)
/* 16D14 8003B914 260702C8 */  addiu     $a3, $s0, 0x2C8
/* 16D18 8003B918 AFB10010 */  sw        $s1, 0x10($sp)
/* 16D1C 8003B91C 00004810 */  mfhi      $t1
/* 16D20 8003B920 01223021 */  addu      $a2, $t1, $v0
/* 16D24 8003B924 000631C3 */  sra       $a2, $a2, 7
/* 16D28 8003B928 000217C3 */  sra       $v0, $v0, 31
/* 16D2C 8003B92C 00C23023 */  subu      $a2, $a2, $v0
/* 16D30 8003B930 28C400FF */  slti      $a0, $a2, 0xFF
/* 16D34 8003B934 000427C0 */  sll       $a0, $a0, 31
/* 16D38 8003B938 3C022000 */  lui       $v0, (0x20000000 >> 16)
/* 16D3C 8003B93C 00822025 */  or        $a0, $a0, $v0
/* 16D40 8003B940 0C0B78F6 */  jal       spr_draw_npc_sprite
/* 16D44 8003B944 00642025 */   or       $a0, $v1, $a0
.L8003B948:
/* 16D48 8003B948 960200BE */  lhu       $v0, 0xBE($s0)
/* 16D4C 8003B94C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 16D50 8003B950 A60200BE */  sh        $v0, 0xBE($s0)
/* 16D54 8003B954 8FBF0024 */  lw        $ra, 0x24($sp)
/* 16D58 8003B958 8FB20020 */  lw        $s2, 0x20($sp)
/* 16D5C 8003B95C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 16D60 8003B960 8FB00018 */  lw        $s0, 0x18($sp)
/* 16D64 8003B964 03E00008 */  jr        $ra
/* 16D68 8003B968 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

s32 npc_draw_palswap_mode_1(Npc* npc, s32 arg1, Matrix4f mtx) {
    s32 i, j;
    s32 temp3;
    PAL_PTR src;
    PAL_PTR dst;

    if (npc->dirtyPalettes != 0) {
        npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16);
        npc->paletteCount = 0;
        while ((s32)npc->spritePaletteList[npc->paletteCount] != -1) {
            npc->paletteCount++;
        }

        npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16);
        for (i = 0; i < npc->paletteCount; i++) {
            dst = npc->localPaletteData[i];
            src = npc->spritePaletteList[i];
            if (src != NULL) {
                for (j = 0; j < 16; j++) {
                    *dst++ = *src++;
                }
            }
        }

        npc->palSwapState = -2;
        npc->palSwapLerpAlpha = 0;
        npc->dirtyPalettes = 0;
        npc->palSwapTimer = 0;
    }

    if (npc->palSwapTimer == 0) {
        npc->palSwapState += 2;
        temp3 = D_80077BF0[npc->palSwapState];
        if (temp3 == 255) {
            npc->palSwapState = 0;
        }
        npc->palSwapTimer = D_80077BF0[npc->palSwapState + 1] / 2;
    }

    temp3 = D_80077BF0[npc->palSwapState];
    npc->palSwapTimer--;

    switch(temp3) {
        case 0:
            for (i = 0; i < npc->unk_C0; i++) {
                dst = npc->localPaletteData[i];
                src = npc->spritePaletteList[i];
                if (src != NULL) {
                    for (j = 0; j < 16; j++) {
                        *dst++ = *src++;
                    }
                }
            }
            break;
        case 1:
            for (i = 0; i < npc->unk_C0; i++) {
                dst = npc->localPaletteData[i];
                src = npc->spritePaletteList[npc->unk_C0 * 5 + i];
                if (src != NULL) {
                    for (j = 0; j < 16; j++) {
                        *dst++ = *src++;
                    }
                }
            }
            break;
        case 2:
            for (i = 0; i < npc->unk_C0; i++) {
                dst = npc->localPaletteData[i];
                src = npc->spritePaletteList[npc->unk_C0 * 6 + i];
                if (src != NULL) {
                    for (j = 0; j < 16; j++) {
                        *dst++ = *src++;
                    }
                }
            }
            break;
    }

    for (i = 0; i < npc->paletteCount; i++) {
        npc->localPalettes[i] = npc->localPaletteData[i];
    }

    if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
        s32 alpha = npc->alpha * npc->alpha2 / 255;
        u32 mask;
        if (alpha < 255) {
            mask = DRAW_SPRITE_OVERRIDE_ALPHA;
        } else {
            mask = 0;
        }
        mask |= DRAW_SPRITE_OVERRIDE_PALETTES;
        spr_draw_npc_sprite(npc->spriteInstanceID | mask, arg1, alpha, npc->localPalettes, mtx);
    }
    npc->palSwapLerpAlpha--;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel pink_sparkles_appendGfx
/* 412BF4 E01244C4 27BDFEE0 */  addiu     $sp, $sp, -0x120
/* 412BF8 E01244C8 3C06DB06 */  lui       $a2, (0xDB060024 >> 16)
/* 412BFC E01244CC 34C60024 */  ori       $a2, $a2, (0xDB060024 & 0xFFFF)
/* 412C00 E01244D0 AFB000E0 */  sw        $s0, 0xE0($sp)
/* 412C04 E01244D4 27B00098 */  addiu     $s0, $sp, 0x98
/* 412C08 E01244D8 AFA40120 */  sw        $a0, 0x120($sp)
/* 412C0C E01244DC 0200202D */  daddu     $a0, $s0, $zero
/* 412C10 E01244E0 AFB300EC */  sw        $s3, 0xEC($sp)
/* 412C14 E01244E4 0000982D */  daddu     $s3, $zero, $zero
/* 412C18 E01244E8 AFB400F0 */  sw        $s4, 0xF0($sp)
/* 412C1C E01244EC 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 412C20 E01244F0 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 412C24 E01244F4 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 412C28 E01244F8 AFBF0104 */  sw        $ra, 0x104($sp)
/* 412C2C E01244FC AFBE0100 */  sw        $fp, 0x100($sp)
/* 412C30 E0124500 AFB700FC */  sw        $s7, 0xFC($sp)
/* 412C34 E0124504 AFB600F8 */  sw        $s6, 0xF8($sp)
/* 412C38 E0124508 AFB500F4 */  sw        $s5, 0xF4($sp)
/* 412C3C E012450C AFB200E8 */  sw        $s2, 0xE8($sp)
/* 412C40 E0124510 AFB100E4 */  sw        $s1, 0xE4($sp)
/* 412C44 E0124514 F7B80118 */  sdc1      $f24, 0x118($sp)
/* 412C48 E0124518 F7B60110 */  sdc1      $f22, 0x110($sp)
/* 412C4C E012451C F7B40108 */  sdc1      $f20, 0x108($sp)
/* 412C50 E0124520 8E830000 */  lw        $v1, 0x0($s4)
/* 412C54 E0124524 8FA90120 */  lw        $t1, 0x120($sp)
/* 412C58 E0124528 0060282D */  daddu     $a1, $v1, $zero
/* 412C5C E012452C 8D31000C */  lw        $s1, 0xC($t1)
/* 412C60 E0124530 24630008 */  addiu     $v1, $v1, 0x8
/* 412C64 E0124534 AE830000 */  sw        $v1, 0x0($s4)
/* 412C68 E0124538 ACA20000 */  sw        $v0, 0x0($a1)
/* 412C6C E012453C 24620008 */  addiu     $v0, $v1, 0x8
/* 412C70 E0124540 ACA00004 */  sw        $zero, 0x4($a1)
/* 412C74 E0124544 AE820000 */  sw        $v0, 0x0($s4)
/* 412C78 E0124548 AC660000 */  sw        $a2, 0x0($v1)
/* 412C7C E012454C 8D250010 */  lw        $a1, 0x10($t1)
/* 412C80 E0124550 24620010 */  addiu     $v0, $v1, 0x10
/* 412C84 E0124554 AE820000 */  sw        $v0, 0x0($s4)
/* 412C88 E0124558 8CA5001C */  lw        $a1, 0x1C($a1)
/* 412C8C E012455C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 412C90 E0124560 AC620008 */  sw        $v0, 0x8($v1)
/* 412C94 E0124564 3C020900 */  lui       $v0, %hi(D_09000F20_327330)
/* 412C98 E0124568 24420F20 */  addiu     $v0, $v0, %lo(D_09000F20_327330)
/* 412C9C E012456C AC62000C */  sw        $v0, 0xC($v1)
/* 412CA0 E0124570 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 412CA4 E0124574 00A22821 */  addu      $a1, $a1, $v0
/* 412CA8 E0124578 AC650004 */  sw        $a1, 0x4($v1)
/* 412CAC E012457C 8E250004 */  lw        $a1, 0x4($s1)
/* 412CB0 E0124580 8E260008 */  lw        $a2, 0x8($s1)
/* 412CB4 E0124584 8E27000C */  lw        $a3, 0xC($s1)
/* 412CB8 E0124588 8E220020 */  lw        $v0, 0x20($s1)
/* 412CBC E012458C 2631002C */  addiu     $s1, $s1, 0x2C
/* 412CC0 E0124590 2442FFFF */  addiu     $v0, $v0, -0x1
/* 412CC4 E0124594 00021840 */  sll       $v1, $v0, 1
/* 412CC8 E0124598 00621821 */  addu      $v1, $v1, $v0
/* 412CCC E012459C 0C080108 */  jal       shim_guTranslateF
/* 412CD0 E01245A0 AFA300D8 */   sw       $v1, 0xD8($sp)
/* 412CD4 E01245A4 27B20058 */  addiu     $s2, $sp, 0x58
/* 412CD8 E01245A8 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 412CDC E01245AC 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 412CE0 E01245B0 44800000 */  mtc1      $zero, $f0
/* 412CE4 E01245B4 00031080 */  sll       $v0, $v1, 2
/* 412CE8 E01245B8 00431021 */  addu      $v0, $v0, $v1
/* 412CEC E01245BC 00021080 */  sll       $v0, $v0, 2
/* 412CF0 E01245C0 00431023 */  subu      $v0, $v0, $v1
/* 412CF4 E01245C4 000218C0 */  sll       $v1, $v0, 3
/* 412CF8 E01245C8 00431021 */  addu      $v0, $v0, $v1
/* 412CFC E01245CC 000210C0 */  sll       $v0, $v0, 3
/* 412D00 E01245D0 44060000 */  mfc1      $a2, $f0
/* 412D04 E01245D4 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 412D08 E01245D8 00220821 */  addu      $at, $at, $v0
/* 412D0C E01245DC C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 412D10 E01245E0 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* 412D14 E01245E4 46000007 */  neg.s     $f0, $f0
/* 412D18 E01245E8 44050000 */  mfc1      $a1, $f0
/* 412D1C E01245EC 0240202D */  daddu     $a0, $s2, $zero
/* 412D20 E01245F0 0C080104 */  jal       shim_guRotateF
/* 412D24 E01245F4 AFA60010 */   sw       $a2, 0x10($sp)
/* 412D28 E01245F8 0240202D */  daddu     $a0, $s2, $zero
/* 412D2C E01245FC 0200282D */  daddu     $a1, $s0, $zero
/* 412D30 E0124600 0C080114 */  jal       shim_guMtxCatF
/* 412D34 E0124604 00A0302D */   daddu    $a2, $a1, $zero
/* 412D38 E0124608 3C013F33 */  lui       $at, (0x3F333333 >> 16)
/* 412D3C E012460C 34213333 */  ori       $at, $at, (0x3F333333 & 0xFFFF)
/* 412D40 E0124610 4481A000 */  mtc1      $at, $f20
/* 412D44 E0124614 8FA90120 */  lw        $t1, 0x120($sp)
/* 412D48 E0124618 3C013FB3 */  lui       $at, (0x3FB33333 >> 16)
/* 412D4C E012461C 34213333 */  ori       $at, $at, (0x3FB33333 & 0xFFFF)
/* 412D50 E0124620 4481B000 */  mtc1      $at, $f22
/* 412D54 E0124624 8D220008 */  lw        $v0, 0x8($t1)
/* 412D58 E0124628 2442FFFF */  addiu     $v0, $v0, -0x1
/* 412D5C E012462C 18400083 */  blez      $v0, .LE012483C
/* 412D60 E0124630 4600A606 */   mov.s    $f24, $f20
/* 412D64 E0124634 0240B02D */  daddu     $s6, $s2, $zero
/* 412D68 E0124638 3C178007 */  lui       $s7, %hi(gMatrixListPos)
/* 412D6C E012463C 26F741F0 */  addiu     $s7, $s7, %lo(gMatrixListPos)
/* 412D70 E0124640 3C150001 */  lui       $s5, (0x11630 >> 16)
/* 412D74 E0124644 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* 412D78 E0124648 0280902D */  daddu     $s2, $s4, $zero
/* 412D7C E012464C 26310024 */  addiu     $s1, $s1, 0x24
/* 412D80 E0124650 8FA900D8 */  lw        $t1, 0xD8($sp)
/* 412D84 E0124654 3C1EE012 */  lui       $fp, %hi(D_E0124BC0)
/* 412D88 E0124658 27DE4BC0 */  addiu     $fp, $fp, %lo(D_E0124BC0)
/* 412D8C E012465C 013E8021 */  addu      $s0, $t1, $fp
.LE0124660:
/* 412D90 E0124660 8E340004 */  lw        $s4, 0x4($s1)
/* 412D94 E0124664 0680006E */  bltz      $s4, .LE0124820
/* 412D98 E0124668 00000000 */   nop
/* 412D9C E012466C 8E25FFE0 */  lw        $a1, -0x20($s1)
/* 412DA0 E0124670 8E26FFE4 */  lw        $a2, -0x1C($s1)
/* 412DA4 E0124674 8E27FFE8 */  lw        $a3, -0x18($s1)
/* 412DA8 E0124678 0C080108 */  jal       shim_guTranslateF
/* 412DAC E012467C 02C0202D */   daddu    $a0, $s6, $zero
/* 412DB0 E0124680 02C0202D */  daddu     $a0, $s6, $zero
/* 412DB4 E0124684 27A50098 */  addiu     $a1, $sp, 0x98
/* 412DB8 E0124688 C6200000 */  lwc1      $f0, 0x0($s1)
/* 412DBC E012468C 27A60018 */  addiu     $a2, $sp, 0x18
/* 412DC0 E0124690 E7A00080 */  swc1      $f0, 0x80($sp)
/* 412DC4 E0124694 E7A0006C */  swc1      $f0, 0x6C($sp)
/* 412DC8 E0124698 0C080114 */  jal       shim_guMtxCatF
/* 412DCC E012469C E7A00058 */   swc1     $f0, 0x58($sp)
/* 412DD0 E01246A0 27A40018 */  addiu     $a0, $sp, 0x18
/* 412DD4 E01246A4 96E50000 */  lhu       $a1, 0x0($s7)
/* 412DD8 E01246A8 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 412DDC E01246AC 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 412DE0 E01246B0 00052980 */  sll       $a1, $a1, 6
/* 412DE4 E01246B4 00B52821 */  addu      $a1, $a1, $s5
/* 412DE8 E01246B8 0C080118 */  jal       shim_guMtxF2L
/* 412DEC E01246BC 00452821 */   addu     $a1, $v0, $a1
/* 412DF0 E01246C0 27C20024 */  addiu     $v0, $fp, 0x24
/* 412DF4 E01246C4 0202102A */  slt       $v0, $s0, $v0
/* 412DF8 E01246C8 50400001 */  beql      $v0, $zero, .LE01246D0
/* 412DFC E01246CC 03C0802D */   daddu    $s0, $fp, $zero
.LE01246D0:
/* 412E00 E01246D0 92020000 */  lbu       $v0, 0x0($s0)
/* 412E04 E01246D4 44822000 */  mtc1      $v0, $f4
/* 412E08 E01246D8 00000000 */  nop
/* 412E0C E01246DC 46802120 */  cvt.s.w   $f4, $f4
/* 412E10 E01246E0 46162102 */  mul.s     $f4, $f4, $f22
/* 412E14 E01246E4 00000000 */  nop
/* 412E18 E01246E8 26100001 */  addiu     $s0, $s0, 0x1
/* 412E1C E01246EC 92020000 */  lbu       $v0, 0x0($s0)
/* 412E20 E01246F0 44821000 */  mtc1      $v0, $f2
/* 412E24 E01246F4 00000000 */  nop
/* 412E28 E01246F8 468010A0 */  cvt.s.w   $f2, $f2
/* 412E2C E01246FC 46181082 */  mul.s     $f2, $f2, $f24
/* 412E30 E0124700 00000000 */  nop
/* 412E34 E0124704 26100001 */  addiu     $s0, $s0, 0x1
/* 412E38 E0124708 92020000 */  lbu       $v0, 0x0($s0)
/* 412E3C E012470C 44820000 */  mtc1      $v0, $f0
/* 412E40 E0124710 00000000 */  nop
/* 412E44 E0124714 46800020 */  cvt.s.w   $f0, $f0
/* 412E48 E0124718 46140002 */  mul.s     $f0, $f0, $f20
/* 412E4C E012471C 00000000 */  nop
/* 412E50 E0124720 4600218D */  trunc.w.s $f6, $f4
/* 412E54 E0124724 44033000 */  mfc1      $v1, $f6
/* 412E58 E0124728 00000000 */  nop
/* 412E5C E012472C 28620100 */  slti      $v0, $v1, 0x100
/* 412E60 E0124730 4600118D */  trunc.w.s $f6, $f2
/* 412E64 E0124734 44073000 */  mfc1      $a3, $f6
/* 412E68 E0124738 4600018D */  trunc.w.s $f6, $f0
/* 412E6C E012473C 44083000 */  mfc1      $t0, $f6
/* 412E70 E0124740 14400002 */  bnez      $v0, .LE012474C
/* 412E74 E0124744 26100001 */   addiu    $s0, $s0, 0x1
/* 412E78 E0124748 240300FF */  addiu     $v1, $zero, 0xFF
.LE012474C:
/* 412E7C E012474C 28E20100 */  slti      $v0, $a3, 0x100
/* 412E80 E0124750 50400001 */  beql      $v0, $zero, .LE0124758
/* 412E84 E0124754 240700FF */   addiu    $a3, $zero, 0xFF
.LE0124758:
/* 412E88 E0124758 29020100 */  slti      $v0, $t0, 0x100
/* 412E8C E012475C 50400001 */  beql      $v0, $zero, .LE0124764
/* 412E90 E0124760 240800FF */   addiu    $t0, $zero, 0xFF
.LE0124764:
/* 412E94 E0124764 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 412E98 E0124768 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 412E9C E012476C 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 412EA0 E0124770 00031E00 */  sll       $v1, $v1, 24
/* 412EA4 E0124774 8E440000 */  lw        $a0, 0x0($s2)
/* 412EA8 E0124778 3C09E012 */  lui       $t1, %hi(D_E01248A0)
/* 412EAC E012477C 252948A0 */  addiu     $t1, $t1, %lo(D_E01248A0)
/* 412EB0 E0124780 0080282D */  daddu     $a1, $a0, $zero
/* 412EB4 E0124784 24840008 */  addiu     $a0, $a0, 0x8
/* 412EB8 E0124788 AE440000 */  sw        $a0, 0x0($s2)
/* 412EBC E012478C ACA20000 */  sw        $v0, 0x0($a1)
/* 412EC0 E0124790 30E200FF */  andi      $v0, $a3, 0xFF
/* 412EC4 E0124794 00021400 */  sll       $v0, $v0, 16
/* 412EC8 E0124798 00621825 */  or        $v1, $v1, $v0
/* 412ECC E012479C 310200FF */  andi      $v0, $t0, 0xFF
/* 412ED0 E01247A0 00021200 */  sll       $v0, $v0, 8
/* 412ED4 E01247A4 00621825 */  or        $v1, $v1, $v0
/* 412ED8 E01247A8 346300FF */  ori       $v1, $v1, 0xFF
/* 412EDC E01247AC 24820008 */  addiu     $v0, $a0, 0x8
/* 412EE0 E01247B0 ACA30004 */  sw        $v1, 0x4($a1)
/* 412EE4 E01247B4 AE420000 */  sw        $v0, 0x0($s2)
/* 412EE8 E01247B8 96E20000 */  lhu       $v0, 0x0($s7)
/* 412EEC E01247BC 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 412EF0 E01247C0 AC830000 */  sw        $v1, 0x0($a0)
/* 412EF4 E01247C4 24430001 */  addiu     $v1, $v0, 0x1
/* 412EF8 E01247C8 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 412EFC E01247CC 00021180 */  sll       $v0, $v0, 6
/* 412F00 E01247D0 A6E30000 */  sh        $v1, 0x0($s7)
/* 412F04 E01247D4 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 412F08 E01247D8 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 412F0C E01247DC 00551021 */  addu      $v0, $v0, $s5
/* 412F10 E01247E0 00621821 */  addu      $v1, $v1, $v0
/* 412F14 E01247E4 24820010 */  addiu     $v0, $a0, 0x10
/* 412F18 E01247E8 AC830004 */  sw        $v1, 0x4($a0)
/* 412F1C E01247EC AE420000 */  sw        $v0, 0x0($s2)
/* 412F20 E01247F0 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 412F24 E01247F4 AC820008 */  sw        $v0, 0x8($a0)
/* 412F28 E01247F8 32820007 */  andi      $v0, $s4, 0x7
/* 412F2C E01247FC 00021080 */  sll       $v0, $v0, 2
/* 412F30 E0124800 00491021 */  addu      $v0, $v0, $t1
/* 412F34 E0124804 8C430000 */  lw        $v1, 0x0($v0)
/* 412F38 E0124808 24820018 */  addiu     $v0, $a0, 0x18
/* 412F3C E012480C AE420000 */  sw        $v0, 0x0($s2)
/* 412F40 E0124810 24020040 */  addiu     $v0, $zero, 0x40
/* 412F44 E0124814 AC860010 */  sw        $a2, 0x10($a0)
/* 412F48 E0124818 AC820014 */  sw        $v0, 0x14($a0)
/* 412F4C E012481C AC83000C */  sw        $v1, 0xC($a0)
.LE0124820:
/* 412F50 E0124820 8FA90120 */  lw        $t1, 0x120($sp)
/* 412F54 E0124824 26730001 */  addiu     $s3, $s3, 0x1
/* 412F58 E0124828 8D220008 */  lw        $v0, 0x8($t1)
/* 412F5C E012482C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 412F60 E0124830 0262102A */  slt       $v0, $s3, $v0
/* 412F64 E0124834 1440FF8A */  bnez      $v0, .LE0124660
/* 412F68 E0124838 2631002C */   addiu    $s1, $s1, 0x2C
.LE012483C:
/* 412F6C E012483C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 412F70 E0124840 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 412F74 E0124844 8C620000 */  lw        $v0, 0x0($v1)
/* 412F78 E0124848 0040202D */  daddu     $a0, $v0, $zero
/* 412F7C E012484C 24420008 */  addiu     $v0, $v0, 0x8
/* 412F80 E0124850 AC620000 */  sw        $v0, 0x0($v1)
/* 412F84 E0124854 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 412F88 E0124858 AC820000 */  sw        $v0, 0x0($a0)
/* 412F8C E012485C AC800004 */  sw        $zero, 0x4($a0)
/* 412F90 E0124860 8FBF0104 */  lw        $ra, 0x104($sp)
/* 412F94 E0124864 8FBE0100 */  lw        $fp, 0x100($sp)
/* 412F98 E0124868 8FB700FC */  lw        $s7, 0xFC($sp)
/* 412F9C E012486C 8FB600F8 */  lw        $s6, 0xF8($sp)
/* 412FA0 E0124870 8FB500F4 */  lw        $s5, 0xF4($sp)
/* 412FA4 E0124874 8FB400F0 */  lw        $s4, 0xF0($sp)
/* 412FA8 E0124878 8FB300EC */  lw        $s3, 0xEC($sp)
/* 412FAC E012487C 8FB200E8 */  lw        $s2, 0xE8($sp)
/* 412FB0 E0124880 8FB100E4 */  lw        $s1, 0xE4($sp)
/* 412FB4 E0124884 8FB000E0 */  lw        $s0, 0xE0($sp)
/* 412FB8 E0124888 D7B80118 */  ldc1      $f24, 0x118($sp)
/* 412FBC E012488C D7B60110 */  ldc1      $f22, 0x110($sp)
/* 412FC0 E0124890 D7B40108 */  ldc1      $f20, 0x108($sp)
/* 412FC4 E0124894 03E00008 */  jr        $ra
/* 412FC8 E0124898 27BD0120 */   addiu    $sp, $sp, 0x120
/* 412FCC E012489C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void pink_sparkles_appendGfx(void* effect) {
    PinkSparklesFXData* part = ((EffectInstance*)effect)->data.pinkSparkles;
    s32 primR;
    s32 primG;
    s32 primB;
    f32 factorR = 1.4f;
    f32 factorG = 0.7f;
    f32 factorB = 0.7f;
    Matrix4f sp18;
    Matrix4f sp58;
    Matrix4f sp98;
    s32 colorIdx;
    s32 i;

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

    colorIdx = (part->unk_20 - 1) * 3;

    shim_guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C);
    shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(sp58, sp98, sp98);

    part++;
    for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) {
        s32 unk_28 = part->unk_28;

        if (unk_28 >= 0) {
            shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);

            sp58[0][0] = sp58[1][1] = sp58[2][2] = part->unk_24;

            shim_guMtxCatF(sp58, sp98, sp18);
            shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

            if (colorIdx >= ARRAY_COUNT(D_E0124BC0)) {
                colorIdx = 0;
            }

            primR = D_E0124BC0[colorIdx++] * factorR;
            primG = D_E0124BC0[colorIdx++] * factorG;
            primB = D_E0124BC0[colorIdx++] * factorB;

            if (primR > 255) {
                primR = 255;
            }
            if (primG > 255) {
                primG = 255;
            }
            if (primB > 255) {
                primB = 255;
            }

            gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, 255);
            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gSPDisplayList(gMainGfxPos++, D_E01248A0[unk_28 & 7]);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }

    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_screen_transition_stencil
/* D0610 80139F10 0080782D */  daddu     $t7, $a0, $zero
/* D0614 80139F14 8FA3001C */  lw        $v1, 0x1C($sp)
/* D0618 80139F18 44864000 */  mtc1      $a2, $f8
/* D061C 80139F1C 04600014 */  bltz      $v1, .L80139F70
/* D0620 80139F20 00A0C02D */   daddu    $t8, $a1, $zero
/* D0624 80139F24 3C04800B */  lui       $a0, %hi(gCameras)
/* D0628 80139F28 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* D062C 80139F2C 00031080 */  sll       $v0, $v1, 2
/* D0630 80139F30 00431021 */  addu      $v0, $v0, $v1
/* D0634 80139F34 00021080 */  sll       $v0, $v0, 2
/* D0638 80139F38 00431023 */  subu      $v0, $v0, $v1
/* D063C 80139F3C 000218C0 */  sll       $v1, $v0, 3
/* D0640 80139F40 00431021 */  addu      $v0, $v0, $v1
/* D0644 80139F44 000210C0 */  sll       $v0, $v0, 3
/* D0648 80139F48 00441021 */  addu      $v0, $v0, $a0
/* D064C 80139F4C 8449000E */  lh        $t1, 0xE($v0)
/* D0650 80139F50 844A0010 */  lh        $t2, 0x10($v0)
/* D0654 80139F54 8443000A */  lh        $v1, 0xA($v0)
/* D0658 80139F58 8442000C */  lh        $v0, 0xC($v0)
/* D065C 80139F5C 01235821 */  addu      $t3, $t1, $v1
/* D0660 80139F60 01426021 */  addu      $t4, $t2, $v0
/* D0664 80139F64 0120682D */  daddu     $t5, $t1, $zero
/* D0668 80139F68 0804E7E2 */  j         .L80139F88
/* D066C 80139F6C 0140702D */   daddu    $t6, $t2, $zero
.L80139F70:
/* D0670 80139F70 0000482D */  daddu     $t1, $zero, $zero
/* D0674 80139F74 0120502D */  daddu     $t2, $t1, $zero
/* D0678 80139F78 240B0140 */  addiu     $t3, $zero, 0x140
/* D067C 80139F7C 240C00F0 */  addiu     $t4, $zero, 0xF0
/* D0680 80139F80 0120682D */  daddu     $t5, $t1, $zero
/* D0684 80139F84 0120702D */  daddu     $t6, $t1, $zero
.L80139F88:
/* D0688 80139F88 44800000 */  mtc1      $zero, $f0
/* D068C 80139F8C 00000000 */  nop
/* D0690 80139F90 46004032 */  c.eq.s    $f8, $f0
/* D0694 80139F94 00000000 */  nop
/* D0698 80139F98 450100F0 */  bc1t      .L8013A35C
/* D069C 80139F9C 3C04ED00 */   lui      $a0, (0xED000000 >> 16)
/* D06A0 80139FA0 3C014080 */  lui       $at, (0x40800000 >> 16)
/* D06A4 80139FA4 44812000 */  mtc1      $at, $f4
/* D06A8 80139FA8 44891000 */  mtc1      $t1, $f2
/* D06AC 80139FAC 00000000 */  nop
/* D06B0 80139FB0 468010A0 */  cvt.s.w   $f2, $f2
/* D06B4 80139FB4 46041082 */  mul.s     $f2, $f2, $f4
/* D06B8 80139FB8 00000000 */  nop
/* D06BC 80139FBC 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* D06C0 80139FC0 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* D06C4 80139FC4 448A0000 */  mtc1      $t2, $f0
/* D06C8 80139FC8 00000000 */  nop
/* D06CC 80139FCC 46800020 */  cvt.s.w   $f0, $f0
/* D06D0 80139FD0 8D060000 */  lw        $a2, 0x0($t0)
/* D06D4 80139FD4 46040002 */  mul.s     $f0, $f0, $f4
/* D06D8 80139FD8 00000000 */  nop
/* D06DC 80139FDC 3C01437F */  lui       $at, (0x437F0000 >> 16)
/* D06E0 80139FE0 44813000 */  mtc1      $at, $f6
/* D06E4 80139FE4 00C0282D */  daddu     $a1, $a2, $zero
/* D06E8 80139FE8 24C60008 */  addiu     $a2, $a2, 0x8
/* D06EC 80139FEC AD060000 */  sw        $a2, 0x0($t0)
/* D06F0 80139FF0 46064032 */  c.eq.s    $f8, $f6
/* D06F4 80139FF4 4600128D */  trunc.w.s $f10, $f2
/* D06F8 80139FF8 44025000 */  mfc1      $v0, $f10
/* D06FC 80139FFC 00000000 */  nop
/* D0700 8013A000 30420FFF */  andi      $v0, $v0, 0xFFF
/* D0704 8013A004 00021300 */  sll       $v0, $v0, 12
/* D0708 8013A008 4600028D */  trunc.w.s $f10, $f0
/* D070C 8013A00C 44035000 */  mfc1      $v1, $f10
/* D0710 8013A010 448B1000 */  mtc1      $t3, $f2
/* D0714 8013A014 00000000 */  nop
/* D0718 8013A018 468010A0 */  cvt.s.w   $f2, $f2
/* D071C 8013A01C 46041082 */  mul.s     $f2, $f2, $f4
/* D0720 8013A020 00000000 */  nop
/* D0724 8013A024 30630FFF */  andi      $v1, $v1, 0xFFF
/* D0728 8013A028 00641825 */  or        $v1, $v1, $a0
/* D072C 8013A02C 00431025 */  or        $v0, $v0, $v1
/* D0730 8013A030 448C0000 */  mtc1      $t4, $f0
/* D0734 8013A034 00000000 */  nop
/* D0738 8013A038 46800020 */  cvt.s.w   $f0, $f0
/* D073C 8013A03C 46040002 */  mul.s     $f0, $f0, $f4
/* D0740 8013A040 00000000 */  nop
/* D0744 8013A044 ACA20000 */  sw        $v0, 0x0($a1)
/* D0748 8013A048 4600128D */  trunc.w.s $f10, $f2
/* D074C 8013A04C 44025000 */  mfc1      $v0, $f10
/* D0750 8013A050 00000000 */  nop
/* D0754 8013A054 30420FFF */  andi      $v0, $v0, 0xFFF
/* D0758 8013A058 00021300 */  sll       $v0, $v0, 12
/* D075C 8013A05C 4600028D */  trunc.w.s $f10, $f0
/* D0760 8013A060 44035000 */  mfc1      $v1, $f10
/* D0764 8013A064 00000000 */  nop
/* D0768 8013A068 30630FFF */  andi      $v1, $v1, 0xFFF
/* D076C 8013A06C 00431025 */  or        $v0, $v0, $v1
/* D0770 8013A070 45000009 */  bc1f      .L8013A098
/* D0774 8013A074 ACA20004 */   sw       $v0, 0x4($a1)
/* D0778 8013A078 3C04FCFF */  lui       $a0, (0xFCFFFFFF >> 16)
/* D077C 8013A07C 3484FFFF */  ori       $a0, $a0, (0xFCFFFFFF & 0xFFFF)
/* D0780 8013A080 3C03FFFD */  lui       $v1, (0xFFFDFCFE >> 16)
/* D0784 8013A084 3463FCFE */  ori       $v1, $v1, (0xFFFDFCFE & 0xFFFF)
/* D0788 8013A088 24C20008 */  addiu     $v0, $a2, 0x8
/* D078C 8013A08C AD020000 */  sw        $v0, 0x0($t0)
/* D0790 8013A090 ACC40000 */  sw        $a0, 0x0($a2)
/* D0794 8013A094 ACC30004 */  sw        $v1, 0x4($a2)
.L8013A098:
/* D0798 8013A098 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* D079C 8013A09C 00071E00 */  sll       $v1, $a3, 24
/* D07A0 8013A0A0 46083001 */  sub.s     $f0, $f6, $f8
/* D07A4 8013A0A4 8D050000 */  lw        $a1, 0x0($t0)
/* D07A8 8013A0A8 3C014128 */  lui       $at, (0x41280000 >> 16)
/* D07AC 8013A0AC 44811000 */  mtc1      $at, $f2
/* D07B0 8013A0B0 3C014200 */  lui       $at, (0x42000000 >> 16)
/* D07B4 8013A0B4 44812000 */  mtc1      $at, $f4
/* D07B8 8013A0B8 00A0202D */  daddu     $a0, $a1, $zero
/* D07BC 8013A0BC 24A50008 */  addiu     $a1, $a1, 0x8
/* D07C0 8013A0C0 AD050000 */  sw        $a1, 0x0($t0)
/* D07C4 8013A0C4 AC820000 */  sw        $v0, 0x0($a0)
/* D07C8 8013A0C8 8FA20010 */  lw        $v0, 0x10($sp)
/* D07CC 8013A0CC 24A7000C */  addiu     $a3, $a1, 0xC
/* D07D0 8013A0D0 304200FF */  andi      $v0, $v0, 0xFF
/* D07D4 8013A0D4 00021400 */  sll       $v0, $v0, 16
/* D07D8 8013A0D8 00621825 */  or        $v1, $v1, $v0
/* D07DC 8013A0DC 8FA20014 */  lw        $v0, 0x14($sp)
/* D07E0 8013A0E0 46020002 */  mul.s     $f0, $f0, $f2
/* D07E4 8013A0E4 00000000 */  nop
/* D07E8 8013A0E8 304200FF */  andi      $v0, $v0, 0xFF
/* D07EC 8013A0EC 00021200 */  sll       $v0, $v0, 8
/* D07F0 8013A0F0 00621825 */  or        $v1, $v1, $v0
/* D07F4 8013A0F4 8FA20018 */  lw        $v0, 0x18($sp)
/* D07F8 8013A0F8 3C018015 */  lui       $at, %hi(D_80150FA0)
/* D07FC 8013A0FC D4220FA0 */  ldc1      $f2, %lo(D_80150FA0)($at)
/* D0800 8013A100 304200FF */  andi      $v0, $v0, 0xFF
/* D0804 8013A104 00621825 */  or        $v1, $v1, $v0
/* D0808 8013A108 24A20008 */  addiu     $v0, $a1, 0x8
/* D080C 8013A10C AC830004 */  sw        $v1, 0x4($a0)
/* D0810 8013A110 AD020000 */  sw        $v0, 0x0($t0)
/* D0814 8013A114 000B1080 */  sll       $v0, $t3, 2
/* D0818 8013A118 30420FFF */  andi      $v0, $v0, 0xFFF
/* D081C 8013A11C 00021300 */  sll       $v0, $v0, 12
/* D0820 8013A120 000C2080 */  sll       $a0, $t4, 2
/* D0824 8013A124 30840FFF */  andi      $a0, $a0, 0xFFF
/* D0828 8013A128 3C03E400 */  lui       $v1, (0xE4000000 >> 16)
/* D082C 8013A12C 00832025 */  or        $a0, $a0, $v1
/* D0830 8013A130 00441025 */  or        $v0, $v0, $a0
/* D0834 8013A134 ACA20000 */  sw        $v0, 0x0($a1)
/* D0838 8013A138 00091080 */  sll       $v0, $t1, 2
/* D083C 8013A13C 30420FFF */  andi      $v0, $v0, 0xFFF
/* D0840 8013A140 00021300 */  sll       $v0, $v0, 12
/* D0844 8013A144 000A1880 */  sll       $v1, $t2, 2
/* D0848 8013A148 30630FFF */  andi      $v1, $v1, 0xFFF
/* D084C 8013A14C 46060003 */  div.s     $f0, $f0, $f6
/* D0850 8013A150 46000021 */  cvt.d.s   $f0, $f0
/* D0854 8013A154 46220000 */  add.d     $f0, $f0, $f2
/* D0858 8013A158 01AF2023 */  subu      $a0, $t5, $t7
/* D085C 8013A15C 44841000 */  mtc1      $a0, $f2
/* D0860 8013A160 00000000 */  nop
/* D0864 8013A164 468010A0 */  cvt.s.w   $f2, $f2
/* D0868 8013A168 46041082 */  mul.s     $f2, $f2, $f4
/* D086C 8013A16C 00000000 */  nop
/* D0870 8013A170 00431025 */  or        $v0, $v0, $v1
/* D0874 8013A174 ACA20004 */  sw        $v0, 0x4($a1)
/* D0878 8013A178 46200120 */  cvt.s.d   $f4, $f0
/* D087C 8013A17C 3C014180 */  lui       $at, (0x41800000 >> 16)
/* D0880 8013A180 44810000 */  mtc1      $at, $f0
/* D0884 8013A184 46041083 */  div.s     $f2, $f2, $f4
/* D0888 8013A188 46001080 */  add.s     $f2, $f2, $f0
/* D088C 8013A18C 3C014480 */  lui       $at, (0x44800000 >> 16)
/* D0890 8013A190 44810000 */  mtc1      $at, $f0
/* D0894 8013A194 24A20010 */  addiu     $v0, $a1, 0x10
/* D0898 8013A198 AD020000 */  sw        $v0, 0x0($t0)
/* D089C 8013A19C 46001000 */  add.s     $f0, $f2, $f0
/* D08A0 8013A1A0 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* D08A4 8013A1A4 44811000 */  mtc1      $at, $f2
/* D08A8 8013A1A8 3C02E100 */  lui       $v0, (0xE1000000 >> 16)
/* D08AC 8013A1AC 4600103E */  c.le.s    $f2, $f0
/* D08B0 8013A1B0 00000000 */  nop
/* D08B4 8013A1B4 45010005 */  bc1t      .L8013A1CC
/* D08B8 8013A1B8 ACA20008 */   sw       $v0, 0x8($a1)
/* D08BC 8013A1BC 4600028D */  trunc.w.s $f10, $f0
/* D08C0 8013A1C0 44035000 */  mfc1      $v1, $f10
/* D08C4 8013A1C4 0804E87A */  j         .L8013A1E8
/* D08C8 8013A1C8 01D81023 */   subu     $v0, $t6, $t8
.L8013A1CC:
/* D08CC 8013A1CC 46020001 */  sub.s     $f0, $f0, $f2
/* D08D0 8013A1D0 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* D08D4 8013A1D4 4600028D */  trunc.w.s $f10, $f0
/* D08D8 8013A1D8 44035000 */  mfc1      $v1, $f10
/* D08DC 8013A1DC 00000000 */  nop
/* D08E0 8013A1E0 00621825 */  or        $v1, $v1, $v0
/* D08E4 8013A1E4 01D81023 */  subu      $v0, $t6, $t8
.L8013A1E8:
/* D08E8 8013A1E8 3C014200 */  lui       $at, (0x42000000 >> 16)
/* D08EC 8013A1EC 44811000 */  mtc1      $at, $f2
/* D08F0 8013A1F0 44820000 */  mtc1      $v0, $f0
/* D08F4 8013A1F4 00000000 */  nop
/* D08F8 8013A1F8 46800020 */  cvt.s.w   $f0, $f0
/* D08FC 8013A1FC 46020002 */  mul.s     $f0, $f0, $f2
/* D0900 8013A200 00000000 */  nop
/* D0904 8013A204 3C014180 */  lui       $at, (0x41800000 >> 16)
/* D0908 8013A208 44811000 */  mtc1      $at, $f2
/* D090C 8013A20C 46040003 */  div.s     $f0, $f0, $f4
/* D0910 8013A210 46020000 */  add.s     $f0, $f0, $f2
/* D0914 8013A214 3C014480 */  lui       $at, (0x44800000 >> 16)
/* D0918 8013A218 44811000 */  mtc1      $at, $f2
/* D091C 8013A21C 00000000 */  nop
/* D0920 8013A220 46020000 */  add.s     $f0, $f0, $f2
/* D0924 8013A224 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* D0928 8013A228 44811000 */  mtc1      $at, $f2
/* D092C 8013A22C 00000000 */  nop
/* D0930 8013A230 4600103E */  c.le.s    $f2, $f0
/* D0934 8013A234 00000000 */  nop
/* D0938 8013A238 45010005 */  bc1t      .L8013A250
/* D093C 8013A23C 00033400 */   sll      $a2, $v1, 16
/* D0940 8013A240 4600028D */  trunc.w.s $f10, $f0
/* D0944 8013A244 44045000 */  mfc1      $a0, $f10
/* D0948 8013A248 0804E89A */  j         .L8013A268
/* D094C 8013A24C 00000000 */   nop
.L8013A250:
/* D0950 8013A250 46020001 */  sub.s     $f0, $f0, $f2
/* D0954 8013A254 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* D0958 8013A258 4600028D */  trunc.w.s $f10, $f0
/* D095C 8013A25C 44045000 */  mfc1      $a0, $f10
/* D0960 8013A260 00000000 */  nop
/* D0964 8013A264 00822025 */  or        $a0, $a0, $v0
.L8013A268:
/* D0968 8013A268 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* D096C 8013A26C 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* D0970 8013A270 3082FFFF */  andi      $v0, $a0, 0xFFFF
/* D0974 8013A274 8CA30000 */  lw        $v1, 0x0($a1)
/* D0978 8013A278 00C21025 */  or        $v0, $a2, $v0
/* D097C 8013A27C ACE20000 */  sw        $v0, 0x0($a3)
/* D0980 8013A280 3C02F100 */  lui       $v0, (0xF1000000 >> 16)
/* D0984 8013A284 3C014480 */  lui       $at, (0x44800000 >> 16)
/* D0988 8013A288 44810000 */  mtc1      $at, $f0
/* D098C 8013A28C 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* D0990 8013A290 44811000 */  mtc1      $at, $f2
/* D0994 8013A294 0060202D */  daddu     $a0, $v1, $zero
/* D0998 8013A298 24630008 */  addiu     $v1, $v1, 0x8
/* D099C 8013A29C 46040003 */  div.s     $f0, $f0, $f4
/* D09A0 8013A2A0 ACA30000 */  sw        $v1, 0x0($a1)
/* D09A4 8013A2A4 AC820000 */  sw        $v0, 0x0($a0)
/* D09A8 8013A2A8 4600103E */  c.le.s    $f2, $f0
/* D09AC 8013A2AC 00000000 */  nop
/* D09B0 8013A2B0 45010005 */  bc1t      .L8013A2C8
/* D09B4 8013A2B4 24840004 */   addiu    $a0, $a0, 0x4
/* D09B8 8013A2B8 4600028D */  trunc.w.s $f10, $f0
/* D09BC 8013A2BC 44035000 */  mfc1      $v1, $f10
/* D09C0 8013A2C0 0804E8B9 */  j         .L8013A2E4
/* D09C4 8013A2C4 00033C00 */   sll      $a3, $v1, 16
.L8013A2C8:
/* D09C8 8013A2C8 46020001 */  sub.s     $f0, $f0, $f2
/* D09CC 8013A2CC 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* D09D0 8013A2D0 4600028D */  trunc.w.s $f10, $f0
/* D09D4 8013A2D4 44035000 */  mfc1      $v1, $f10
/* D09D8 8013A2D8 00000000 */  nop
/* D09DC 8013A2DC 00621825 */  or        $v1, $v1, $v0
/* D09E0 8013A2E0 00033C00 */  sll       $a3, $v1, 16
.L8013A2E4:
/* D09E4 8013A2E4 3C014480 */  lui       $at, (0x44800000 >> 16)
/* D09E8 8013A2E8 44810000 */  mtc1      $at, $f0
/* D09EC 8013A2EC 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* D09F0 8013A2F0 44811000 */  mtc1      $at, $f2
/* D09F4 8013A2F4 46040003 */  div.s     $f0, $f0, $f4
/* D09F8 8013A2F8 4600103E */  c.le.s    $f2, $f0
/* D09FC 8013A2FC 00000000 */  nop
/* D0A00 8013A300 45030005 */  bc1tl     .L8013A318
/* D0A04 8013A304 46020001 */   sub.s    $f0, $f0, $f2
/* D0A08 8013A308 4600028D */  trunc.w.s $f10, $f0
/* D0A0C 8013A30C 44065000 */  mfc1      $a2, $f10
/* D0A10 8013A310 0804E8CB */  j         .L8013A32C
/* D0A14 8013A314 00000000 */   nop
.L8013A318:
/* D0A18 8013A318 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* D0A1C 8013A31C 4600028D */  trunc.w.s $f10, $f0
/* D0A20 8013A320 44065000 */  mfc1      $a2, $f10
/* D0A24 8013A324 00000000 */  nop
/* D0A28 8013A328 00C23025 */  or        $a2, $a2, $v0
.L8013A32C:
/* D0A2C 8013A32C 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* D0A30 8013A330 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* D0A34 8013A334 30C2FFFF */  andi      $v0, $a2, 0xFFFF
/* D0A38 8013A338 8CA30000 */  lw        $v1, 0x0($a1)
/* D0A3C 8013A33C 00E21025 */  or        $v0, $a3, $v0
/* D0A40 8013A340 AC820000 */  sw        $v0, 0x0($a0)
/* D0A44 8013A344 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* D0A48 8013A348 0060202D */  daddu     $a0, $v1, $zero
/* D0A4C 8013A34C 24630008 */  addiu     $v1, $v1, 0x8
/* D0A50 8013A350 ACA30000 */  sw        $v1, 0x0($a1)
/* D0A54 8013A354 AC820000 */  sw        $v0, 0x0($a0)
/* D0A58 8013A358 AC800004 */  sw        $zero, 0x4($a0)
.L8013A35C:
/* D0A5C 8013A35C 03E00008 */  jr        $ra
/* D0A60 8013A360 00000000 */   nop
/* D0A64 8013A364 00000000 */  nop
/* D0A68 8013A368 00000000 */  nop
/* D0A6C 8013A36C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void appendGfx_screen_transition_stencil(s32 arg0, s32 arg1, f32 progress, s32 primR, s32 primG, s32 primB, s32 primA, s32 camID) {
    s32 x1, y1, x2, y2, t5, t6;
    f32 texScale;

    if (camID >= 0) {
        x1 = gCameras[camID].viewportStartX;
        y1 = gCameras[camID].viewportStartY;
        x2 = gCameras[camID].viewportStartX + gCameras[camID].viewportW;
        y2 = gCameras[camID].viewportStartY + gCameras[camID].viewportH;
        t5 = x1;
        t6 = y1;
    } else {
        x1 = 0;
        y1 = 0;
        x2 = SCREEN_WIDTH;
        y2 = SCREEN_HEIGHT;
        t5 = 0;
        t6 = 0;
    }

    if (progress == 0.0f) {
        return;
    }

    gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
    if (progress == 255.0f) {
        gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08);
    }
    gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA);
    texScale = (255.0f - progress) * 10.5f / 255.0f + 0.09; // range from
    gSPTextureRectangle(gMainGfxPos++, x1 * 4, y1 * 4, x2 * 4, y2 * 4, G_TX_RENDERTILE,
                        (t5 - arg0) * 32.0f / texScale + 16.0f + 1024.0f, (t6 - arg1) * 32.0f / texScale + 16.0f + 1024.0f,
                        1024.0f / texScale, 1024.0f / texScale);
    gDPPipeSync(gMainGfxPos++);
}