### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8005904C
/* 3444C 8005904C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 34450 80059050 AFB3001C */  sw        $s3, 0x1C($sp)
/* 34454 80059054 0080982D */  daddu     $s3, $a0, $zero
/* 34458 80059058 30A500FF */  andi      $a1, $a1, 0xFF
/* 3445C 8005905C 24A5FFFF */  addiu     $a1, $a1, -0x1
/* 34460 80059060 2CA2000A */  sltiu     $v0, $a1, 0xA
/* 34464 80059064 AFBF0020 */  sw        $ra, 0x20($sp)
/* 34468 80059068 AFB20018 */  sw        $s2, 0x18($sp)
/* 3446C 8005906C AFB10014 */  sw        $s1, 0x14($sp)
/* 34470 80059070 AFB00010 */  sw        $s0, 0x10($sp)
/* 34474 80059074 8E660000 */  lw        $a2, 0x0($s3)
/* 34478 80059078 10400021 */  beqz      $v0, .L80059100
/* 3447C 8005907C 00051080 */   sll      $v0, $a1, 2
/* 34480 80059080 3C01800A */  lui       $at, %hi(jtbl_80098940)
/* 34484 80059084 00220821 */  addu      $at, $at, $v0
/* 34488 80059088 8C228940 */  lw        $v0, %lo(jtbl_80098940)($at)
/* 3448C 8005908C 00400008 */  jr        $v0
/* 34490 80059090 00000000 */   nop
glabel .L80059094
/* 34494 80059094 3C048008 */  lui       $a0, %hi(SMALLROOM_PARAMS_N)
/* 34498 80059098 08016442 */  j         .L80059108
/* 3449C 8005909C 2484EFE0 */   addiu    $a0, $a0, %lo(SMALLROOM_PARAMS_N)
glabel .L800590A0
/* 344A0 800590A0 3C048008 */  lui       $a0, %hi(D_8007F158)
/* 344A4 800590A4 08016442 */  j         .L80059108
/* 344A8 800590A8 2484F158 */   addiu    $a0, $a0, %lo(D_8007F158)
glabel .L800590AC
/* 344AC 800590AC 3C048008 */  lui       $a0, %hi(D_8007F180)
/* 344B0 800590B0 08016442 */  j         .L80059108
/* 344B4 800590B4 2484F180 */   addiu    $a0, $a0, %lo(D_8007F180)
glabel .L800590B8
/* 344B8 800590B8 3C048008 */  lui       $a0, %hi(D_8007F1A8)
/* 344BC 800590BC 08016442 */  j         .L80059108
/* 344C0 800590C0 2484F1A8 */   addiu    $a0, $a0, %lo(D_8007F1A8)
glabel .L800590C4
/* 344C4 800590C4 3C048008 */  lui       $a0, %hi(AU_FX_CUSTOM_PARAMS)
/* 344C8 800590C8 08016442 */  j         .L80059108
/* 344CC 800590CC 8C84F1F8 */   lw       $a0, %lo(AU_FX_CUSTOM_PARAMS)($a0)
glabel .L800590D0
/* 344D0 800590D0 3C048008 */  lui       $a0, %hi(D_8007F1FC)
/* 344D4 800590D4 08016442 */  j         .L80059108
/* 344D8 800590D8 8C84F1FC */   lw       $a0, %lo(D_8007F1FC)($a0)
glabel .L800590DC
/* 344DC 800590DC 3C048008 */  lui       $a0, %hi(D_8007F200)
/* 344E0 800590E0 08016442 */  j         .L80059108
/* 344E4 800590E4 8C84F200 */   lw       $a0, %lo(D_8007F200)($a0)
glabel .L800590E8
/* 344E8 800590E8 3C048008 */  lui       $a0, %hi(D_8007F204)
/* 344EC 800590EC 08016442 */  j         .L80059108
/* 344F0 800590F0 8C84F204 */   lw       $a0, %lo(D_8007F204)($a0)
glabel .L800590F4
/* 344F4 800590F4 3C048008 */  lui       $a0, %hi(D_8007F048)
/* 344F8 800590F8 08016442 */  j         .L80059108
/* 344FC 800590FC 2484F048 */   addiu    $a0, $a0, %lo(D_8007F048)
.L80059100:
/* 34500 80059100 3C048008 */  lui       $a0, %hi(D_8007F1D0)
/* 34504 80059104 2484F1D0 */  addiu     $a0, $a0, %lo(D_8007F1D0)
.L80059108:
/* 34508 80059108 90820003 */  lbu       $v0, 0x3($a0)
/* 3450C 8005910C A2620010 */  sb        $v0, 0x10($s3)
/* 34510 80059110 8C830004 */  lw        $v1, 0x4($a0)
/* 34514 80059114 8E620000 */  lw        $v0, 0x0($s3)
/* 34518 80059118 24110507 */  addiu     $s1, $zero, 0x507
/* 3451C 8005911C AE620004 */  sw        $v0, 0x4($s3)
/* 34520 80059120 00031040 */  sll       $v0, $v1, 1
/* 34524 80059124 00431021 */  addu      $v0, $v0, $v1
/* 34528 80059128 000210C0 */  sll       $v0, $v0, 3
/* 3452C 8005912C 00431023 */  subu      $v0, $v0, $v1
/* 34530 80059130 000210C0 */  sll       $v0, $v0, 3
/* 34534 80059134 AE620008 */  sw        $v0, 0x8($s3)
.L80059138:
/* 34538 80059138 ACC00000 */  sw        $zero, 0x0($a2)
/* 3453C 8005913C 2631FFFF */  addiu     $s1, $s1, -0x1
/* 34540 80059140 0621FFFD */  bgez      $s1, .L80059138
/* 34544 80059144 24C60004 */   addiu    $a2, $a2, 0x4
/* 34548 80059148 92620010 */  lbu       $v0, 0x10($s3)
/* 3454C 8005914C 10400069 */  beqz      $v0, .L800592F4
/* 34550 80059150 0000882D */   daddu    $s1, $zero, $zero
/* 34554 80059154 0220902D */  daddu     $s2, $s1, $zero
/* 34558 80059158 24020002 */  addiu     $v0, $zero, 0x2
/* 3455C 8005915C 00421004 */  sllv      $v0, $v0, $v0
/* 34560 80059160 00448021 */  addu      $s0, $v0, $a0
.L80059164:
/* 34564 80059164 8E62000C */  lw        $v0, 0xC($s3)
/* 34568 80059168 8E030000 */  lw        $v1, 0x0($s0)
/* 3456C 8005916C 26100004 */  addiu     $s0, $s0, 0x4
/* 34570 80059170 00522021 */  addu      $a0, $v0, $s2
/* 34574 80059174 00031040 */  sll       $v0, $v1, 1
/* 34578 80059178 00431021 */  addu      $v0, $v0, $v1
/* 3457C 8005917C 000210C0 */  sll       $v0, $v0, 3
/* 34580 80059180 00431023 */  subu      $v0, $v0, $v1
/* 34584 80059184 000210C0 */  sll       $v0, $v0, 3
/* 34588 80059188 AC820000 */  sw        $v0, 0x0($a0)
/* 3458C 8005918C 8E030000 */  lw        $v1, 0x0($s0)
/* 34590 80059190 26100004 */  addiu     $s0, $s0, 0x4
/* 34594 80059194 00031040 */  sll       $v0, $v1, 1
/* 34598 80059198 00431021 */  addu      $v0, $v0, $v1
/* 3459C 8005919C 000210C0 */  sll       $v0, $v0, 3
/* 345A0 800591A0 00431023 */  subu      $v0, $v0, $v1
/* 345A4 800591A4 000210C0 */  sll       $v0, $v0, 3
/* 345A8 800591A8 AC820004 */  sw        $v0, 0x4($a0)
/* 345AC 800591AC 96020002 */  lhu       $v0, 0x2($s0)
/* 345B0 800591B0 26100004 */  addiu     $s0, $s0, 0x4
/* 345B4 800591B4 A482000A */  sh        $v0, 0xA($a0)
/* 345B8 800591B8 96020002 */  lhu       $v0, 0x2($s0)
/* 345BC 800591BC 26100004 */  addiu     $s0, $s0, 0x4
/* 345C0 800591C0 A4820008 */  sh        $v0, 0x8($a0)
/* 345C4 800591C4 96020002 */  lhu       $v0, 0x2($s0)
/* 345C8 800591C8 26100004 */  addiu     $s0, $s0, 0x4
/* 345CC 800591CC A482000C */  sh        $v0, 0xC($a0)
/* 345D0 800591D0 8E020000 */  lw        $v0, 0x0($s0)
/* 345D4 800591D4 50400033 */  beql      $v0, $zero, .L800592A4
/* 345D8 800591D8 AC800028 */   sw       $zero, 0x28($a0)
/* 345DC 800591DC 26100004 */  addiu     $s0, $s0, 0x4
/* 345E0 800591E0 44820000 */  mtc1      $v0, $f0
/* 345E4 800591E4 00000000 */  nop
/* 345E8 800591E8 46800020 */  cvt.s.w   $f0, $f0
/* 345EC 800591EC 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* 345F0 800591F0 44811000 */  mtc1      $at, $f2
/* 345F4 800591F4 8C830004 */  lw        $v1, 0x4($a0)
/* 345F8 800591F8 8C820000 */  lw        $v0, 0x0($a0)
/* 345FC 800591FC 46020003 */  div.s     $f0, $f0, $f2
/* 34600 80059200 46000021 */  cvt.d.s   $f0, $f0
/* 34604 80059204 00621823 */  subu      $v1, $v1, $v0
/* 34608 80059208 46200000 */  add.d     $f0, $f0, $f0
/* 3460C 8005920C 3C028008 */  lui       $v0, %hi(gActiveSynDriverPtr)
/* 34610 80059210 8C428E50 */  lw        $v0, %lo(gActiveSynDriverPtr)($v0)
/* 34614 80059214 44832000 */  mtc1      $v1, $f4
/* 34618 80059218 00000000 */  nop
/* 3461C 8005921C 46802121 */  cvt.d.w   $f4, $f4
/* 34620 80059220 C4420008 */  lwc1      $f2, 0x8($v0)
/* 34624 80059224 468010A1 */  cvt.d.w   $f2, $f2
/* 34628 80059228 46220003 */  div.d     $f0, $f0, $f2
/* 3462C 8005922C 46200020 */  cvt.s.d   $f0, $f0
/* 34630 80059230 E4800010 */  swc1      $f0, 0x10($a0)
/* 34634 80059234 C6000000 */  lwc1      $f0, 0x0($s0)
/* 34638 80059238 46800020 */  cvt.s.w   $f0, $f0
/* 3463C 8005923C 26100004 */  addiu     $s0, $s0, 0x4
/* 34640 80059240 3C01800A */  lui       $at, %hi(D_80098968)
/* 34644 80059244 D4228968 */  ldc1      $f2, %lo(D_80098968)($at)
/* 34648 80059248 46000021 */  cvt.d.s   $f0, $f0
/* 3464C 8005924C 04610006 */  bgez      $v1, .L80059268
/* 34650 80059250 46220083 */   div.d    $f2, $f0, $f2
/* 34654 80059254 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 34658 80059258 44810800 */  mtc1      $at, $f1
/* 3465C 8005925C 44800000 */  mtc1      $zero, $f0
/* 34660 80059260 00000000 */  nop
/* 34664 80059264 46202100 */  add.d     $f4, $f4, $f0
.L80059268:
/* 34668 80059268 46241002 */  mul.d     $f0, $f2, $f4
/* 3466C 8005926C 00000000 */  nop
/* 34670 80059270 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 34674 80059274 44811000 */  mtc1      $at, $f2
/* 34678 80059278 8C82002C */  lw        $v0, 0x2C($a0)
/* 3467C 8005927C AC800018 */  sw        $zero, 0x18($a0)
/* 34680 80059280 E4820014 */  swc1      $f2, 0x14($a0)
/* 34684 80059284 AC820028 */  sw        $v0, 0x28($a0)
/* 34688 80059288 46200020 */  cvt.s.d   $f0, $f0
/* 3468C 8005928C E480001C */  swc1      $f0, 0x1C($a0)
/* 34690 80059290 AC400008 */  sw        $zero, 0x8($v0)
/* 34694 80059294 8C830028 */  lw        $v1, 0x28($a0)
/* 34698 80059298 24020001 */  addiu     $v0, $zero, 0x1
/* 3469C 8005929C 080164AA */  j         .L800592A8
/* 346A0 800592A0 AC62000C */   sw       $v0, 0xC($v1)
.L800592A4:
/* 346A4 800592A4 26100008 */  addiu     $s0, $s0, 0x8
.L800592A8:
/* 346A8 800592A8 8E020000 */  lw        $v0, 0x0($s0)
/* 346AC 800592AC 5040000A */  beql      $v0, $zero, .L800592D8
/* 346B0 800592B0 AC800020 */   sw       $zero, 0x20($a0)
/* 346B4 800592B4 8C830024 */  lw        $v1, 0x24($a0)
/* 346B8 800592B8 AC830020 */  sw        $v1, 0x20($a0)
/* 346BC 800592BC 96020002 */  lhu       $v0, 0x2($s0)
/* 346C0 800592C0 A4620000 */  sh        $v0, 0x0($v1)
/* 346C4 800592C4 8C840020 */  lw        $a0, 0x20($a0)
/* 346C8 800592C8 0C016374 */  jal       _init_lpfilter
/* 346CC 800592CC 26100004 */   addiu    $s0, $s0, 0x4
/* 346D0 800592D0 080164B8 */  j         .L800592E0
/* 346D4 800592D4 26520030 */   addiu    $s2, $s2, 0x30
.L800592D8:
/* 346D8 800592D8 26100004 */  addiu     $s0, $s0, 0x4
/* 346DC 800592DC 26520030 */  addiu     $s2, $s2, 0x30
.L800592E0:
/* 346E0 800592E0 92620010 */  lbu       $v0, 0x10($s3)
/* 346E4 800592E4 26310001 */  addiu     $s1, $s1, 0x1
/* 346E8 800592E8 0222102A */  slt       $v0, $s1, $v0
/* 346EC 800592EC 1440FF9D */  bnez      $v0, .L80059164
/* 346F0 800592F0 00000000 */   nop
.L800592F4:
/* 346F4 800592F4 8FBF0020 */  lw        $ra, 0x20($sp)
/* 346F8 800592F8 8FB3001C */  lw        $s3, 0x1C($sp)
/* 346FC 800592FC 8FB20018 */  lw        $s2, 0x18($sp)
/* 34700 80059300 8FB10014 */  lw        $s1, 0x14($sp)
/* 34704 80059304 8FB00010 */  lw        $s0, 0x10($sp)
/* 34708 80059308 03E00008 */  jr        $ra
/* 3470C 8005930C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void func_8005904C(AuFX* fx, u8 effectType) {
    s32* params;
    s32* clr;
    s32 i, j;
    clr = (s32*)fx->base;

    switch (effectType) {
        case AU_FX_SMALLROOM:
            params = SMALL_ROOM_PARAMS;
            break;
        case AU_FX_BIGROOM:
            params = BIG_ROOM_PARAMS;
            break;
        case AU_FX_ECHO:
            params = ECHO_PARAMS;
            break;
        case AU_FX_CHORUS:
            params = CHORUS_PARAMS;
            break;
        case AU_FX_FLANGE:
            params = FLANGE_PARAMS;
            break;
        case AU_FX_CUSTOM_0:
            params = AU_FX_CUSTOM_PARAMS[0];
            break;
        case AU_FX_CUSTOM_1:
            params = AU_FX_CUSTOM_PARAMS[1];
            break;
        case AU_FX_CUSTOM_2:
            params = AU_FX_CUSTOM_PARAMS[2];
            break;
        case AU_FX_CUSTOM_3:
            params = AU_FX_CUSTOM_PARAMS[3];
            break;
        case AU_FX_OTHER_BIGROOM:
            params = BIG_ROOM_PARAMS;
            break;
        default:
            params = NULL_PARAMS;
            break;
    }

    j = 0;
    fx->delayCount = params[j++];
    fx->length = params[j++] * AUDIO_SAMPLES;
    fx->input = fx->base;

    for (i = 0; i < AU_FX_LENGTH/2; i++) {
        *clr++ = 0;
    }

    for (i = 0; i < fx->delayCount; i++) {
        AuDelay* delay = &fx->delays[i];
        delay->input  = params[j++] * AUDIO_SAMPLES;
        delay->output = params[j++] * AUDIO_SAMPLES;
        delay->fbcoef = (u16) params[j++];
        delay->ffcoef = (u16) params[j++];
        delay->gain   = (u16) params[j++];

        if (params[j]) {
            delay->rsinc = (2.0 * (params[j++] / 1000.0f)) / gActiveSynDriverPtr->outputRate;
            delay->rsgain = ((f32)params[j++] / CONVERT) * (delay->output - delay->input);
            delay->rsval = 1.0f;
            delay->rsdelta = 0.0f;
            delay->resampler_28 = delay->resampler_2C;
            delay->resampler_2C->delta = 0.0;
            delay->resampler_28->first = 1;
        } else {
            delay->resampler_28 = NULL;
            j++;
            j++;
        }

        if (params[j]) {
            delay->lowpass_20 = delay->lowpass_24;
            delay->lowpass_20->fc = params[j++];
            _init_lpfilter(delay->lowpass_20);
        } else {
            delay->lowpass_20 = NULL;
            j++;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_bgm_player_initialize
/* 299D8 8004E5D8 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 299DC 8004E5DC AFB10014 */  sw        $s1, 0x14($sp)
/* 299E0 8004E5E0 0080882D */  daddu     $s1, $a0, $zero
/* 299E4 8004E5E4 AFB00010 */  sw        $s0, 0x10($sp)
/* 299E8 8004E5E8 0000802D */  daddu     $s0, $zero, $zero
/* 299EC 8004E5EC 2408FFFF */  addiu     $t0, $zero, -0x1
/* 299F0 8004E5F0 3C057FFF */  lui       $a1, (0x7FFF0000 >> 16)
/* 299F4 8004E5F4 24070040 */  addiu     $a3, $zero, 0x40
/* 299F8 8004E5F8 2406007F */  addiu     $a2, $zero, 0x7F
/* 299FC 8004E5FC 2404025C */  addiu     $a0, $zero, 0x25C
/* 29A00 8004E600 AFBF0018 */  sw        $ra, 0x18($sp)
.L8004E604:
/* 29A04 8004E604 02241021 */  addu      $v0, $s1, $a0
/* 29A08 8004E608 AC48000C */  sw        $t0, 0xC($v0)
/* 29A0C 8004E60C AC450018 */  sw        $a1, 0x18($v0)
/* 29A10 8004E610 A047004A */  sb        $a3, 0x4A($v0)
/* 29A14 8004E614 A040004B */  sb        $zero, 0x4B($v0)
/* 29A18 8004E618 A4400044 */  sh        $zero, 0x44($v0)
/* 29A1C 8004E61C A4400046 */  sh        $zero, 0x46($v0)
/* 29A20 8004E620 A0400048 */  sb        $zero, 0x48($v0)
/* 29A24 8004E624 A0460049 */  sb        $a2, 0x49($v0)
/* 29A28 8004E628 A040004C */  sb        $zero, 0x4C($v0)
/* 29A2C 8004E62C AC45002C */  sw        $a1, 0x2C($v0)
/* 29A30 8004E630 AC400004 */  sw        $zero, 0x4($v0)
/* 29A34 8004E634 AC400008 */  sw        $zero, 0x8($v0)
/* 29A38 8004E638 A440003E */  sh        $zero, 0x3E($v0)
/* 29A3C 8004E63C A4400038 */  sh        $zero, 0x38($v0)
/* 29A40 8004E640 A0400056 */  sb        $zero, 0x56($v0)
/* 29A44 8004E644 A440003A */  sh        $zero, 0x3A($v0)
/* 29A48 8004E648 A0400055 */  sb        $zero, 0x55($v0)
/* 29A4C 8004E64C AC40001C */  sw        $zero, 0x1C($v0)
/* 29A50 8004E650 AC400020 */  sw        $zero, 0x20($v0)
/* 29A54 8004E654 AC400024 */  sw        $zero, 0x24($v0)
/* 29A58 8004E658 AC400030 */  sw        $zero, 0x30($v0)
/* 29A5C 8004E65C A4400034 */  sh        $zero, 0x34($v0)
/* 29A60 8004E660 A4400036 */  sh        $zero, 0x36($v0)
/* 29A64 8004E664 A040004D */  sb        $zero, 0x4D($v0)
/* 29A68 8004E668 A040004E */  sb        $zero, 0x4E($v0)
/* 29A6C 8004E66C A040004F */  sb        $zero, 0x4F($v0)
/* 29A70 8004E670 A0400050 */  sb        $zero, 0x50($v0)
/* 29A74 8004E674 A0400051 */  sb        $zero, 0x51($v0)
/* 29A78 8004E678 A0400054 */  sb        $zero, 0x54($v0)
/* 29A7C 8004E67C A0400057 */  sb        $zero, 0x57($v0)
/* 29A80 8004E680 A0400058 */  sb        $zero, 0x58($v0)
/* 29A84 8004E684 A0400059 */  sb        $zero, 0x59($v0)
/* 29A88 8004E688 A040005A */  sb        $zero, 0x5A($v0)
/* 29A8C 8004E68C 92230235 */  lbu       $v1, 0x235($s1)
/* 29A90 8004E690 A043005B */  sb        $v1, 0x5B($v0)
/* 29A94 8004E694 A050005C */  sb        $s0, 0x5C($v0)
/* 29A98 8004E698 26100001 */  addiu     $s0, $s0, 0x1
/* 29A9C 8004E69C 2A020010 */  slti      $v0, $s0, 0x10
/* 29AA0 8004E6A0 1440FFD8 */  bnez      $v0, .L8004E604
/* 29AA4 8004E6A4 24840060 */   addiu    $a0, $a0, 0x60
/* 29AA8 8004E6A8 0000802D */  daddu     $s0, $zero, $zero
/* 29AAC 8004E6AC 2404FFFF */  addiu     $a0, $zero, -0x1
/* 29AB0 8004E6B0 3C014000 */  lui       $at, (0x40000000 >> 16)
/* 29AB4 8004E6B4 44810000 */  mtc1      $at, $f0
/* 29AB8 8004E6B8 2403085C */  addiu     $v1, $zero, 0x85C
.L8004E6BC:
/* 29ABC 8004E6BC 02231021 */  addu      $v0, $s1, $v1
/* 29AC0 8004E6C0 26100001 */  addiu     $s0, $s0, 0x1
/* 29AC4 8004E6C4 AC440000 */  sw        $a0, 0x0($v0)
/* 29AC8 8004E6C8 E4400004 */  swc1      $f0, 0x4($v0)
/* 29ACC 8004E6CC A4400014 */  sh        $zero, 0x14($v0)
/* 29AD0 8004E6D0 A0400016 */  sb        $zero, 0x16($v0)
/* 29AD4 8004E6D4 AC40000C */  sw        $zero, 0xC($v0)
/* 29AD8 8004E6D8 A0400012 */  sb        $zero, 0x12($v0)
/* 29ADC 8004E6DC 2A020018 */  slti      $v0, $s0, 0x18
/* 29AE0 8004E6E0 1440FFF6 */  bnez      $v0, .L8004E6BC
/* 29AE4 8004E6E4 24630018 */   addiu    $v1, $v1, 0x18
/* 29AE8 8004E6E8 0C014240 */  jal       func_80050900
/* 29AEC 8004E6EC 0220202D */   daddu    $a0, $s1, $zero
/* 29AF0 8004E6F0 0000802D */  daddu     $s0, $zero, $zero
/* 29AF4 8004E6F4 3C014300 */  lui       $at, (0x43000000 >> 16)
/* 29AF8 8004E6F8 44810000 */  mtc1      $at, $f0
/* 29AFC 8004E6FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 29B00 8004E700 44811000 */  mtc1      $at, $f2
/* 29B04 8004E704 24023CF0 */  addiu     $v0, $zero, 0x3CF0
/* 29B08 8004E708 AE2200B0 */  sw        $v0, 0xB0($s1)
/* 29B0C 8004E70C 2402009C */  addiu     $v0, $zero, 0x9C
/* 29B10 8004E710 A6220208 */  sh        $v0, 0x208($s1)
/* 29B14 8004E714 24020080 */  addiu     $v0, $zero, 0x80
/* 29B18 8004E718 A222021E */  sb        $v0, 0x21E($s1)
/* 29B1C 8004E71C 3C027F00 */  lui       $v0, (0x7F000000 >> 16)
/* 29B20 8004E720 AE2200C0 */  sw        $v0, 0xC0($s1)
/* 29B24 8004E724 24020001 */  addiu     $v0, $zero, 0x1
/* 29B28 8004E728 AE200020 */  sw        $zero, 0x20($s1)
/* 29B2C 8004E72C AE200074 */  sw        $zero, 0x74($s1)
/* 29B30 8004E730 AE2000B8 */  sw        $zero, 0xB8($s1)
/* 29B34 8004E734 A620020C */  sh        $zero, 0x20C($s1)
/* 29B38 8004E738 A620020E */  sh        $zero, 0x20E($s1)
/* 29B3C 8004E73C AE2000CC */  sw        $zero, 0xCC($s1)
/* 29B40 8004E740 AE2000C8 */  sw        $zero, 0xC8($s1)
/* 29B44 8004E744 AE2000C4 */  sw        $zero, 0xC4($s1)
/* 29B48 8004E748 AE20016C */  sw        $zero, 0x16C($s1)
/* 29B4C 8004E74C A2200170 */  sb        $zero, 0x170($s1)
/* 29B50 8004E750 A2200171 */  sb        $zero, 0x171($s1)
/* 29B54 8004E754 AE200164 */  sw        $zero, 0x164($s1)
/* 29B58 8004E758 AE200160 */  sw        $zero, 0x160($s1)
/* 29B5C 8004E75C AE20015C */  sw        $zero, 0x15C($s1)
/* 29B60 8004E760 AE200158 */  sw        $zero, 0x158($s1)
/* 29B64 8004E764 AE200168 */  sw        $zero, 0x168($s1)
/* 29B68 8004E768 A2200210 */  sb        $zero, 0x210($s1)
/* 29B6C 8004E76C A2200222 */  sb        $zero, 0x222($s1)
/* 29B70 8004E770 A2200223 */  sb        $zero, 0x223($s1)
/* 29B74 8004E774 AE200204 */  sw        $zero, 0x204($s1)
/* 29B78 8004E778 A2200232 */  sb        $zero, 0x232($s1)
/* 29B7C 8004E77C A2220233 */  sb        $v0, 0x233($s1)
/* 29B80 8004E780 A2200211 */  sb        $zero, 0x211($s1)
/* 29B84 8004E784 E62000D0 */  swc1      $f0, 0xD0($s1)
/* 29B88 8004E788 E62200D0 */  swc1      $f2, 0xD0($s1)
/* 29B8C 8004E78C 0220202D */  daddu     $a0, $s1, $zero
.L8004E790:
/* 29B90 8004E790 0C013A11 */  jal       func_8004E844
/* 29B94 8004E794 0200282D */   daddu    $a1, $s0, $zero
/* 29B98 8004E798 26100001 */  addiu     $s0, $s0, 0x1
/* 29B9C 8004E79C 2A020008 */  slti      $v0, $s0, 0x8
/* 29BA0 8004E7A0 1440FFFB */  bnez      $v0, .L8004E790
/* 29BA4 8004E7A4 0220202D */   daddu    $a0, $s1, $zero
/* 29BA8 8004E7A8 24100003 */  addiu     $s0, $zero, 0x3
/* 29BAC 8004E7AC 02301021 */  addu      $v0, $s1, $s0
.L8004E7B0:
/* 29BB0 8004E7B0 A0400224 */  sb        $zero, 0x224($v0)
/* 29BB4 8004E7B4 2610FFFF */  addiu     $s0, $s0, -0x1
/* 29BB8 8004E7B8 0601FFFD */  bgez      $s0, .L8004E7B0
/* 29BBC 8004E7BC 2442FFFF */   addiu    $v0, $v0, -0x1
/* 29BC0 8004E7C0 0000802D */  daddu     $s0, $zero, $zero
/* 29BC4 8004E7C4 0220182D */  daddu     $v1, $s1, $zero
/* 29BC8 8004E7C8 A2200220 */  sb        $zero, 0x220($s1)
/* 29BCC 8004E7CC AE200018 */  sw        $zero, 0x18($s1)
.L8004E7D0:
/* 29BD0 8004E7D0 8E220068 */  lw        $v0, 0x68($s1)
/* 29BD4 8004E7D4 26100001 */  addiu     $s0, $s0, 0x1
/* 29BD8 8004E7D8 AC6200D8 */  sw        $v0, 0xD8($v1)
/* 29BDC 8004E7DC 2A020020 */  slti      $v0, $s0, 0x20
/* 29BE0 8004E7E0 1440FFFB */  bnez      $v0, .L8004E7D0
/* 29BE4 8004E7E4 24630004 */   addiu    $v1, $v1, 0x4
/* 29BE8 8004E7E8 8E240068 */  lw        $a0, 0x68($s1)
/* 29BEC 8004E7EC 24050001 */  addiu     $a1, $zero, 0x1
/* 29BF0 8004E7F0 3C07F000 */  lui       $a3, (0xF0000000 >> 16)
/* 29BF4 8004E7F4 3C063000 */  lui       $a2, (0x30000000 >> 16)
.L8004E7F8:
/* 29BF8 8004E7F8 8C830000 */  lw        $v1, 0x0($a0)
/* 29BFC 8004E7FC 14600003 */  bnez      $v1, .L8004E80C
/* 29C00 8004E800 24840004 */   addiu    $a0, $a0, 0x4
/* 29C04 8004E804 08013A09 */  j         .L8004E824
glabel func_8004E808
/* 29C08 8004E808 0000282D */   daddu    $a1, $zero, $zero
.L8004E80C:
/* 29C0C 8004E80C 00671024 */  and       $v0, $v1, $a3
/* 29C10 8004E810 14460004 */  bne       $v0, $a2, .L8004E824
/* 29C14 8004E814 3062001F */   andi     $v0, $v1, 0x1F
/* 29C18 8004E818 00021080 */  sll       $v0, $v0, 2
/* 29C1C 8004E81C 02221021 */  addu      $v0, $s1, $v0
/* 29C20 8004E820 AC4400D8 */  sw        $a0, 0xD8($v0)
.L8004E824:
/* 29C24 8004E824 14A0FFF4 */  bnez      $a1, .L8004E7F8
/* 29C28 8004E828 24020002 */   addiu    $v0, $zero, 0x2
/* 29C2C 8004E82C A2220221 */  sb        $v0, 0x221($s1)
/* 29C30 8004E830 8FBF0018 */  lw        $ra, 0x18($sp)
/* 29C34 8004E834 8FB10014 */  lw        $s1, 0x14($sp)
/* 29C38 8004E838 8FB00010 */  lw        $s0, 0x10($sp)
/* 29C3C 8004E83C 03E00008 */  jr        $ra
/* 29C40 8004E840 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void au_bgm_player_initialize(BGMPlayer* player) {
    s32* buf;
    s32 cmd;
    s32 keepReading;
    s32 i;

    for (i = 0; i < ARRAY_COUNT(player->tracks); i++) {
        BGMPlayerTrack* track = &player->tracks[i];
        track->instrument = NO_INSTRUMENT;
        track->subTrackVolume = 0x7FFF0000;
        track->subTrackPan = 0x40;
        track->subTrackReverb = 0;
        track->patch = 0;
        track->subTrackCoarseTune = 0;
        track->subTrackFineTune = 0;
        track->segTrackVolume = 0x7F;
        track->unk_4C = 0;
        track->unkVolume = 0x7FFF0000;
        track->savedPos = NULL;
        track->prevReadPos = NULL;
        track->detourLength = 0;
        track->segTrackTune = 0;
        track->trackTremoloTime = 0;
        track->trackTremoloAmount = 0;
        track->trackTremoloSpeed = 0;
        track->subTrackVolumeStep = 0;
        track->subTrackVolumeTarget = 0;
        track->subTrackVolumeTime = 0;
        track->unkVolumeStep = 0;
        track->unkVolumeTarget = 0;
        track->unkVolumeTime = 0;
        track->unk_4D = 0;
        track->unk_4E = 0;
        track->unk_4F = 0;
        track->unk_50 = 0;
        track->unk_51 = 0;
        track->polyphonicIdx = 0;
        track->unk_57 = 0;
        track->isDrumTrack = FALSE;
        track->parentTrackIdx = 0;
        track->unk_5A = 0;
        track->subtrackBusId = player->busId;
        track->index = i;
    }

    for (i = 0; i < ARRAY_COUNT(player->notes); i++) {
        SeqNote* note = &player->notes[i];
        note->ins = NO_INSTRUMENT;
        note->pitchRatio = 2.0f;
        note->unk_14 = 0;
        note->noteVelocity = 0;
        note->noteLength = 0;
        note->tremoloTime = 0;
    }

    func_80050900(player);
    player->playbackRate = 128.0f; // set to 1.0 later om...
    player->masterTempo = BGM_DEFAULT_TEMPO;
    player->masterTempoBPM = BGM_DEFAULT_TEMPO / 100;
    player->unk_21E = 0x80;
    player->masterVolume = 0x7F000000;
    player->fadeSongName = 0;
    player->unk_74 = 0;
    player->masterTempoTarget = 0;
    player->masterPitchShift = 0;
    player->detune = 0;
    player->masterVolumeTime = 0;
    player->masterVolumeTarget = 0;
    player->masterVolumeStep = 0;
    player->proxMixValue = 0;
    player->proxMixID = 0;
    player->proxMixVolume = 0;
    player->segActiveLoopEndPos[3] = NULL;
    player->segActiveLoopEndPos[2] = NULL;
    player->segActiveLoopEndPos[1] = NULL;
    player->segActiveLoopEndPos[0] = NULL;
    *(s32*)player->segLoopCounters = 0;
    player->segLoopDepth = 0;
    player->unk_222 = 0;
    player->unk_223 = 0;
    player->trackVolsConfig = NULL;
    player->bFadeConfigSetsVolume = FALSE;
    player->unk_233 = 1;
    player->unk_211 = 0;
    player->playbackRate = 1.0f;

    for (i = 0; i < ARRAY_COUNT(player->unk_212); i++) {
        func_8004E844(player, i);
    }

    for (i = 0; i < ARRAY_COUNT(player->effectValues); i++) {
        player->effectValues[i] = 0;
    }

    player->unk_220 = 0;
    player->songPlayingCounter = 0;
    for (i = 0; i < ARRAY_COUNT(player->segLoopStartLabels); i++) {
        player->segLoopStartLabels[i] = player->segmentReadPos;
    }

    // find labels
    buf = player->segmentReadPos;
    keepReading = TRUE;
    while (keepReading) {
        cmd = *buf++;
        if (cmd == 0) {
            keepReading = FALSE;
        } else if ((cmd & 0xF0000000) == BGM_SEGMENT_LABEL << 28) {
            player->segLoopStartLabels[cmd & 0x1F] = buf;
        }
    }

    player->masterState = BGM_PLAY_STATE_NEXT_SUBSEG;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel npc_raycast_down_sides
/* 7602C 800DCB7C 27BDFF80 */  addiu     $sp, $sp, -0x80
/* 76030 800DCB80 AFB40048 */  sw        $s4, 0x48($sp)
/* 76034 800DCB84 8FB40090 */  lw        $s4, 0x90($sp)
/* 76038 800DCB88 AFBF004C */  sw        $ra, 0x4C($sp)
/* 7603C 800DCB8C AFB30044 */  sw        $s3, 0x44($sp)
/* 76040 800DCB90 AFB20040 */  sw        $s2, 0x40($sp)
/* 76044 800DCB94 AFB1003C */  sw        $s1, 0x3C($sp)
/* 76048 800DCB98 AFB00038 */  sw        $s0, 0x38($sp)
/* 7604C 800DCB9C F7BE0078 */  sdc1      $f30, 0x78($sp)
/* 76050 800DCBA0 F7BC0070 */  sdc1      $f28, 0x70($sp)
/* 76054 800DCBA4 F7BA0068 */  sdc1      $f26, 0x68($sp)
/* 76058 800DCBA8 F7B80060 */  sdc1      $f24, 0x60($sp)
/* 7605C 800DCBAC F7B60058 */  sdc1      $f22, 0x58($sp)
/* 76060 800DCBB0 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 76064 800DCBB4 C4A60000 */  lwc1      $f6, 0x0($a1)
/* 76068 800DCBB8 00C0882D */  daddu     $s1, $a2, $zero
/* 7606C 800DCBBC E7A60028 */  swc1      $f6, 0x28($sp)
/* 76070 800DCBC0 C63E0000 */  lwc1      $f30, 0x0($s1)
/* 76074 800DCBC4 C4E60000 */  lwc1      $f6, 0x0($a3)
/* 76078 800DCBC8 3C128011 */  lui       $s2, %hi(D_8010C970)
/* 7607C 800DCBCC 2652C970 */  addiu     $s2, $s2, %lo(D_8010C970)
/* 76080 800DCBD0 E7A6002C */  swc1      $f6, 0x2C($sp)
/* 76084 800DCBD4 4600F18D */  trunc.w.s $f6, $f30
/* 76088 800DCBD8 E6460000 */  swc1      $f6, 0x0($s2)
/* 7608C 800DCBDC C6200000 */  lwc1      $f0, 0x0($s1)
/* 76090 800DCBE0 4600018D */  trunc.w.s $f6, $f0
/* 76094 800DCBE4 3C018011 */  lui       $at, %hi(D_8010C94C)
/* 76098 800DCBE8 E426C94C */  swc1      $f6, %lo(D_8010C94C)($at)
/* 7609C 800DCBEC C6200000 */  lwc1      $f0, 0x0($s1)
/* 760A0 800DCBF0 0080982D */  daddu     $s3, $a0, $zero
/* 760A4 800DCBF4 4600018D */  trunc.w.s $f6, $f0
/* 760A8 800DCBF8 3C018011 */  lui       $at, %hi(D_8010C974)
/* 760AC 800DCBFC E426C974 */  swc1      $f6, %lo(D_8010C974)($at)
/* 760B0 800DCC00 C6800000 */  lwc1      $f0, 0x0($s4)
/* 760B4 800DCC04 44806000 */  mtc1      $zero, $f12
/* 760B8 800DCC08 0C00A6C9 */  jal       clamp_angle
/* 760BC 800DCC0C 46000605 */   abs.s    $f24, $f0
/* 760C0 800DCC10 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 760C4 800DCC14 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 760C8 800DCC18 44811000 */  mtc1      $at, $f2
/* 760CC 800DCC1C 00000000 */  nop
/* 760D0 800DCC20 46020002 */  mul.s     $f0, $f0, $f2
/* 760D4 800DCC24 00000000 */  nop
/* 760D8 800DCC28 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 760DC 800DCC2C 44811000 */  mtc1      $at, $f2
/* 760E0 800DCC30 00000000 */  nop
/* 760E4 800DCC34 46020503 */  div.s     $f20, $f0, $f2
/* 760E8 800DCC38 0C00A85B */  jal       sin_rad
/* 760EC 800DCC3C 4600A306 */   mov.s    $f12, $f20
/* 760F0 800DCC40 46000586 */  mov.s     $f22, $f0
/* 760F4 800DCC44 0C00A874 */  jal       cos_rad
/* 760F8 800DCC48 4600A306 */   mov.s    $f12, $f20
/* 760FC 800DCC4C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 76100 800DCC50 44813000 */  mtc1      $at, $f6
/* 76104 800DCC54 00000000 */  nop
/* 76108 800DCC58 4606B102 */  mul.s     $f4, $f22, $f6
/* 7610C 800DCC5C 00000000 */  nop
/* 76110 800DCC60 0000802D */  daddu     $s0, $zero, $zero
/* 76114 800DCC64 0260202D */  daddu     $a0, $s3, $zero
/* 76118 800DCC68 27A50018 */  addiu     $a1, $sp, 0x18
/* 7611C 800DCC6C 46003087 */  neg.s     $f2, $f6
/* 76120 800DCC70 46020002 */  mul.s     $f0, $f0, $f2
/* 76124 800DCC74 00000000 */  nop
/* 76128 800DCC78 27A6001C */  addiu     $a2, $sp, 0x1C
/* 7612C 800DCC7C 27A70020 */  addiu     $a3, $sp, 0x20
/* 76130 800DCC80 C7A60028 */  lwc1      $f6, 0x28($sp)
/* 76134 800DCC84 3C01C6FF */  lui       $at, (0xC6FFFE00 >> 16)
/* 76138 800DCC88 3421FE00 */  ori       $at, $at, (0xC6FFFE00 & 0xFFFF)
/* 7613C 800DCC8C 4481D000 */  mtc1      $at, $f26
/* 76140 800DCC90 46043080 */  add.s     $f2, $f6, $f4
/* 76144 800DCC94 C7A6002C */  lwc1      $f6, 0x2C($sp)
/* 76148 800DCC98 27A20024 */  addiu     $v0, $sp, 0x24
/* 7614C 800DCC9C E7BE001C */  swc1      $f30, 0x1C($sp)
/* 76150 800DCCA0 E7B80024 */  swc1      $f24, 0x24($sp)
/* 76154 800DCCA4 46003000 */  add.s     $f0, $f6, $f0
/* 76158 800DCCA8 4600D706 */  mov.s     $f28, $f26
/* 7615C 800DCCAC E7A20018 */  swc1      $f2, 0x18($sp)
/* 76160 800DCCB0 E7A00020 */  swc1      $f0, 0x20($sp)
/* 76164 800DCCB4 0C037140 */  jal       npc_raycast_down
/* 76168 800DCCB8 AFA20010 */   sw       $v0, 0x10($sp)
/* 7616C 800DCCBC 0440000F */  bltz      $v0, .L800DCCFC
/* 76170 800DCCC0 E7B80030 */   swc1     $f24, 0x30($sp)
/* 76174 800DCCC4 C7A00024 */  lwc1      $f0, 0x24($sp)
/* 76178 800DCCC8 4618003E */  c.le.s    $f0, $f24
/* 7617C 800DCCCC 00000000 */  nop
/* 76180 800DCCD0 4500000A */  bc1f      .L800DCCFC
/* 76184 800DCCD4 00000000 */   nop
/* 76188 800DCCD8 46000606 */  mov.s     $f24, $f0
/* 7618C 800DCCDC C7BA001C */  lwc1      $f26, 0x1C($sp)
/* 76190 800DCCE0 24100001 */  addiu     $s0, $zero, 0x1
/* 76194 800DCCE4 3C018011 */  lui       $at, %hi(NpcHitQueryColliderID)
/* 76198 800DCCE8 AC22C978 */  sw        $v0, %lo(NpcHitQueryColliderID)($at)
/* 7619C 800DCCEC 3C018011 */  lui       $at, %hi(D_8010C98C)
/* 761A0 800DCCF0 AC22C98C */  sw        $v0, %lo(D_8010C98C)($at)
/* 761A4 800DCCF4 4600D18D */  trunc.w.s $f6, $f26
/* 761A8 800DCCF8 E6460000 */  swc1      $f6, 0x0($s2)
.L800DCCFC:
/* 761AC 800DCCFC 3C014334 */  lui       $at, (0x43340000 >> 16)
/* 761B0 800DCD00 44816000 */  mtc1      $at, $f12
/* 761B4 800DCD04 44803000 */  mtc1      $zero, $f6
/* 761B8 800DCD08 0C00A6C9 */  jal       clamp_angle
/* 761BC 800DCD0C 460C3300 */   add.s    $f12, $f6, $f12
/* 761C0 800DCD10 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 761C4 800DCD14 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 761C8 800DCD18 44811000 */  mtc1      $at, $f2
/* 761CC 800DCD1C 00000000 */  nop
/* 761D0 800DCD20 46020002 */  mul.s     $f0, $f0, $f2
/* 761D4 800DCD24 00000000 */  nop
/* 761D8 800DCD28 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 761DC 800DCD2C 44811000 */  mtc1      $at, $f2
/* 761E0 800DCD30 00000000 */  nop
/* 761E4 800DCD34 46020503 */  div.s     $f20, $f0, $f2
/* 761E8 800DCD38 0C00A85B */  jal       sin_rad
/* 761EC 800DCD3C 4600A306 */   mov.s    $f12, $f20
/* 761F0 800DCD40 46000586 */  mov.s     $f22, $f0
/* 761F4 800DCD44 0C00A874 */  jal       cos_rad
/* 761F8 800DCD48 4600A306 */   mov.s    $f12, $f20
/* 761FC 800DCD4C 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 76200 800DCD50 44813000 */  mtc1      $at, $f6
/* 76204 800DCD54 00000000 */  nop
/* 76208 800DCD58 46163102 */  mul.s     $f4, $f6, $f22
/* 7620C 800DCD5C 00000000 */  nop
/* 76210 800DCD60 46003087 */  neg.s     $f2, $f6
/* 76214 800DCD64 46001002 */  mul.s     $f0, $f2, $f0
/* 76218 800DCD68 00000000 */  nop
/* 7621C 800DCD6C 0260202D */  daddu     $a0, $s3, $zero
/* 76220 800DCD70 27A50018 */  addiu     $a1, $sp, 0x18
/* 76224 800DCD74 C7A60028 */  lwc1      $f6, 0x28($sp)
/* 76228 800DCD78 27A6001C */  addiu     $a2, $sp, 0x1C
/* 7622C 800DCD7C 46043080 */  add.s     $f2, $f6, $f4
/* 76230 800DCD80 C7A6002C */  lwc1      $f6, 0x2C($sp)
/* 76234 800DCD84 27A70020 */  addiu     $a3, $sp, 0x20
/* 76238 800DCD88 46003000 */  add.s     $f0, $f6, $f0
/* 7623C 800DCD8C C7A60030 */  lwc1      $f6, 0x30($sp)
/* 76240 800DCD90 27A20024 */  addiu     $v0, $sp, 0x24
/* 76244 800DCD94 E7BE001C */  swc1      $f30, 0x1C($sp)
/* 76248 800DCD98 E7A60024 */  swc1      $f6, 0x24($sp)
/* 7624C 800DCD9C E7A20018 */  swc1      $f2, 0x18($sp)
/* 76250 800DCDA0 E7A00020 */  swc1      $f0, 0x20($sp)
/* 76254 800DCDA4 0C037140 */  jal       npc_raycast_down
/* 76258 800DCDA8 AFA20010 */   sw       $v0, 0x10($sp)
/* 7625C 800DCDAC 04400010 */  bltz      $v0, .L800DCDF0
/* 76260 800DCDB0 00000000 */   nop
/* 76264 800DCDB4 C7A00024 */  lwc1      $f0, 0x24($sp)
/* 76268 800DCDB8 4618003E */  c.le.s    $f0, $f24
/* 7626C 800DCDBC 00000000 */  nop
/* 76270 800DCDC0 4500000B */  bc1f      .L800DCDF0
/* 76274 800DCDC4 00000000 */   nop
/* 76278 800DCDC8 46000606 */  mov.s     $f24, $f0
/* 7627C 800DCDCC C7BC001C */  lwc1      $f28, 0x1C($sp)
/* 76280 800DCDD0 24100001 */  addiu     $s0, $zero, 0x1
/* 76284 800DCDD4 3C018011 */  lui       $at, %hi(NpcHitQueryColliderID)
/* 76288 800DCDD8 AC22C978 */  sw        $v0, %lo(NpcHitQueryColliderID)($at)
/* 7628C 800DCDDC 3C018011 */  lui       $at, %hi(D_8010C968)
/* 76290 800DCDE0 AC22C968 */  sw        $v0, %lo(D_8010C968)($at)
/* 76294 800DCDE4 4600E18D */  trunc.w.s $f6, $f28
/* 76298 800DCDE8 3C018011 */  lui       $at, %hi(D_8010C94C)
/* 7629C 800DCDEC E426C94C */  swc1      $f6, %lo(D_8010C94C)($at)
.L800DCDF0:
/* 762A0 800DCDF0 12000011 */  beqz      $s0, .L800DCE38
/* 762A4 800DCDF4 0000102D */   daddu    $v0, $zero, $zero
/* 762A8 800DCDF8 461CD03C */  c.lt.s    $f26, $f28
/* 762AC 800DCDFC 00000000 */  nop
/* 762B0 800DCE00 45020002 */  bc1fl     .L800DCE0C
/* 762B4 800DCE04 E63A0000 */   swc1     $f26, 0x0($s1)
/* 762B8 800DCE08 E63C0000 */  swc1      $f28, 0x0($s1)
.L800DCE0C:
/* 762BC 800DCE0C C6200000 */  lwc1      $f0, 0x0($s1)
/* 762C0 800DCE10 3C01C6FF */  lui       $at, (0xC6FFFE00 >> 16)
/* 762C4 800DCE14 3421FE00 */  ori       $at, $at, (0xC6FFFE00 & 0xFFFF)
/* 762C8 800DCE18 44813000 */  mtc1      $at, $f6
/* 762CC 800DCE1C 00000000 */  nop
/* 762D0 800DCE20 4606003C */  c.lt.s    $f0, $f6
/* 762D4 800DCE24 00000000 */  nop
/* 762D8 800DCE28 45030001 */  bc1tl     .L800DCE30
/* 762DC 800DCE2C E6260000 */   swc1     $f6, 0x0($s1)
.L800DCE30:
/* 762E0 800DCE30 E6980000 */  swc1      $f24, 0x0($s4)
/* 762E4 800DCE34 24020001 */  addiu     $v0, $zero, 0x1
.L800DCE38:
/* 762E8 800DCE38 8FBF004C */  lw        $ra, 0x4C($sp)
/* 762EC 800DCE3C 8FB40048 */  lw        $s4, 0x48($sp)
/* 762F0 800DCE40 8FB30044 */  lw        $s3, 0x44($sp)
/* 762F4 800DCE44 8FB20040 */  lw        $s2, 0x40($sp)
/* 762F8 800DCE48 8FB1003C */  lw        $s1, 0x3C($sp)
/* 762FC 800DCE4C 8FB00038 */  lw        $s0, 0x38($sp)
/* 76300 800DCE50 D7BE0078 */  ldc1      $f30, 0x78($sp)
/* 76304 800DCE54 D7BC0070 */  ldc1      $f28, 0x70($sp)
/* 76308 800DCE58 D7BA0068 */  ldc1      $f26, 0x68($sp)
/* 7630C 800DCE5C D7B80060 */  ldc1      $f24, 0x60($sp)
/* 76310 800DCE60 D7B60058 */  ldc1      $f22, 0x58($sp)
/* 76314 800DCE64 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 76318 800DCE68 03E00008 */  jr        $ra
/* 7631C 800DCE6C 27BD0080 */   addiu    $sp, $sp, 0x80

### DECOMPILED C INSTRUCTIONS:

s32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth) {
    f32 startX;
    f32 startY;
    f32 startZ;
    f32 depth;
    f32 x;
    f32 y;
    f32 z;
    f32 originalDepth;
    f32 hitYUnused;
    s32 hasCollision;
    f32 cosTheta;
    s32 colliderID;
    f32 deltaX,deltaZ;
    f32 yaw;
    f32 theta, sinTheta, minDepth, hitYAhead, hitYBehind, radius;

    hasCollision = FALSE;

    x = *posX;
    y = *posY;
    z = *posZ;

    D_8010C970 = y;
    D_8010C94C = *posY;
    D_8010C974 = *posY;

    hitYUnused = hitYBehind = hitYAhead = -32767.0f;
    yaw = 0.0f;

    minDepth = fabsf(*hitDepth);
    theta = DEG_TO_RAD(clamp_angle(yaw));
    sinTheta = sin_rad(theta);
    cosTheta = cos_rad(theta);

    radius = 10.0f;

    deltaX = radius * sinTheta;
    deltaZ = -radius * cosTheta;

    startX = x + deltaX;
    startY = y;
    startZ = z + deltaZ;
    originalDepth = depth = minDepth;

    colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth);
    if (colliderID >= 0) {
        if (depth <= minDepth) {
            hitYAhead = startY;
            NpcHitQueryColliderID = colliderID;
            D_8010C98C = colliderID;
            D_8010C970 = hitYAhead;
            minDepth = depth;
            hasCollision = TRUE;
        }
    }

    theta = DEG_TO_RAD(clamp_angle(yaw + 180.0f));
    sinTheta = sin_rad(theta);
    cosTheta = cos_rad(theta);
    deltaX = radius * sinTheta;
    deltaZ = -radius * cosTheta;

    startX = x + deltaX;
    startY = y;
    startZ = z + deltaZ;
    depth = originalDepth;

    colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth);
    if (colliderID >= 0) {
        if (depth <= minDepth) {
            hitYBehind = startY;
            NpcHitQueryColliderID = colliderID;
            D_8010C968 = colliderID;
            D_8010C94C = hitYBehind;
            minDepth = depth;
            hasCollision = TRUE;
        }
    }

    if (hasCollision) {
        *posY = MAX(hitYBehind, hitYAhead);
        if (*posY < hitYUnused) {
            *posY = hitYUnused;
        }
        *hitDepth = minDepth;
        return TRUE;
    }

    return FALSE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gfx_draw_frame
/* 1F08 80026B08 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 1F0C 80026B0C 3C04800A */  lui       $a0, %hi(gDisplayContext)
/* 1F10 80026B10 8C84A674 */  lw        $a0, %lo(gDisplayContext)($a0)
/* 1F14 80026B14 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 1F18 80026B18 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 1F1C 80026B1C AFB00010 */  sw        $s0, 0x10($sp)
/* 1F20 80026B20 3C10800A */  lui       $s0, %hi(gOverrideFlags)
/* 1F24 80026B24 2610A650 */  addiu     $s0, $s0, %lo(gOverrideFlags)
/* 1F28 80026B28 AFBF0018 */  sw        $ra, 0x18($sp)
/* 1F2C 80026B2C AFB10014 */  sw        $s1, 0x14($sp)
/* 1F30 80026B30 3C018007 */  lui       $at, %hi(gMatrixListPos)
/* 1F34 80026B34 A42041F0 */  sh        $zero, %lo(gMatrixListPos)($at)
/* 1F38 80026B38 8E020000 */  lw        $v0, 0x0($s0)
/* 1F3C 80026B3C 24830230 */  addiu     $v1, $a0, 0x230
/* 1F40 80026B40 30420008 */  andi      $v0, $v0, 0x8
/* 1F44 80026B44 10400007 */  beqz      $v0, .L80026B64
/* 1F48 80026B48 ACA30000 */   sw       $v1, 0x0($a1)
/* 1F4C 80026B4C 3C038007 */  lui       $v1, %hi(gCurrentDisplayContextIndex)
/* 1F50 80026B50 246341F4 */  addiu     $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 1F54 80026B54 8C620000 */  lw        $v0, 0x0($v1)
/* 1F58 80026B58 38420001 */  xori      $v0, $v0, 0x1
/* 1F5C 80026B5C 08009B72 */  j         .L80026DC8
/* 1F60 80026B60 AC620000 */   sw       $v0, 0x0($v1)
.L80026B64:
/* 1F64 80026B64 3C03DA38 */  lui       $v1, (0xDA380003 >> 16)
/* 1F68 80026B68 34630003 */  ori       $v1, $v1, (0xDA380003 & 0xFFFF)
/* 1F6C 80026B6C 24820238 */  addiu     $v0, $a0, 0x238
/* 1F70 80026B70 ACA20000 */  sw        $v0, 0x0($a1)
/* 1F74 80026B74 3C028007 */  lui       $v0, %hi(MasterIdentityMtx)
/* 1F78 80026B78 244241A8 */  addiu     $v0, $v0, %lo(MasterIdentityMtx)
/* 1F7C 80026B7C AC830230 */  sw        $v1, 0x230($a0)
/* 1F80 80026B80 0C0B7698 */  jal       spr_render_init
/* 1F84 80026B84 AC820234 */   sw       $v0, 0x234($a0)
/* 1F88 80026B88 8E020000 */  lw        $v0, 0x0($s0)
/* 1F8C 80026B8C 30420002 */  andi      $v0, $v0, 0x2
/* 1F90 80026B90 14400003 */  bnez      $v0, .L80026BA0
/* 1F94 80026B94 00000000 */   nop
/* 1F98 80026B98 0C00B5CF */  jal       render_frame
/* 1F9C 80026B9C 0000202D */   daddu    $a0, $zero, $zero
.L80026BA0:
/* 1FA0 80026BA0 0C038098 */  jal       player_render_interact_prompts
/* 1FA4 80026BA4 00000000 */   nop
/* 1FA8 80026BA8 0C0B0FB9 */  jal       func_802C3EE4
/* 1FAC 80026BAC 00000000 */   nop
/* 1FB0 80026BB0 0C04E088 */  jal       render_screen_overlay_backUI
/* 1FB4 80026BB4 00000000 */   nop
/* 1FB8 80026BB8 0C048D54 */  jal       render_workers_backUI
/* 1FBC 80026BBC 00000000 */   nop
/* 1FC0 80026BC0 0C050884 */  jal       render_hud_elements_backUI
/* 1FC4 80026BC4 00000000 */   nop
/* 1FC8 80026BC8 0C0167E5 */  jal       render_effects_UI
/* 1FCC 80026BCC 00000000 */   nop
/* 1FD0 80026BD0 0C044BD6 */  jal       state_render_backUI
/* 1FD4 80026BD4 00000000 */   nop
/* 1FD8 80026BD8 8E020000 */  lw        $v0, 0x0($s0)
/* 1FDC 80026BDC 3C030001 */  lui       $v1, (0x10000 >> 16)
/* 1FE0 80026BE0 00431024 */  and       $v0, $v0, $v1
/* 1FE4 80026BE4 14400003 */  bnez      $v0, .L80026BF4
/* 1FE8 80026BE8 00000000 */   nop
/* 1FEC 80026BEC 0C051EB1 */  jal       render_window_root
/* 1FF0 80026BF0 00000000 */   nop
.L80026BF4:
/* 1FF4 80026BF4 8E020000 */  lw        $v0, 0x0($s0)
/* 1FF8 80026BF8 30420002 */  andi      $v0, $v0, 0x2
/* 1FFC 80026BFC 14400009 */  bnez      $v0, .L80026C24
/* 2000 80026C00 3C100010 */   lui      $s0, (0x100010 >> 16)
/* 2004 80026C04 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 2008 80026C08 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 200C 80026C0C 80420078 */  lb        $v0, 0x78($v0)
/* 2010 80026C10 14400004 */  bnez      $v0, .L80026C24
/* 2014 80026C14 00000000 */   nop
/* 2018 80026C18 0C00B5CF */  jal       render_frame
/* 201C 80026C1C 24040001 */   addiu    $a0, $zero, 0x1
/* 2020 80026C20 3C100010 */  lui       $s0, (0x100010 >> 16)
.L80026C24:
/* 2024 80026C24 3C11800A */  lui       $s1, %hi(gOverrideFlags)
/* 2028 80026C28 2631A650 */  addiu     $s1, $s1, %lo(gOverrideFlags)
/* 202C 80026C2C 8E220000 */  lw        $v0, 0x0($s1)
/* 2030 80026C30 36100010 */  ori       $s0, $s0, (0x100010 & 0xFFFF)
/* 2034 80026C34 00501024 */  and       $v0, $v0, $s0
/* 2038 80026C38 14400003 */  bnez      $v0, .L80026C48
/* 203C 80026C3C 00000000 */   nop
/* 2040 80026C40 0C049081 */  jal       render_messages
/* 2044 80026C44 00000000 */   nop
.L80026C48:
/* 2048 80026C48 0C048D38 */  jal       render_workers_frontUI
/* 204C 80026C4C 00000000 */   nop
/* 2050 80026C50 0C0509C7 */  jal       render_hud_elements_frontUI
/* 2054 80026C54 00000000 */   nop
/* 2058 80026C58 0C04E068 */  jal       render_screen_overlay_frontUI
/* 205C 80026C5C 00000000 */   nop
/* 2060 80026C60 8E220000 */  lw        $v0, 0x0($s1)
/* 2064 80026C64 24030010 */  addiu     $v1, $zero, 0x10
/* 2068 80026C68 00501024 */  and       $v0, $v0, $s0
/* 206C 80026C6C 14430003 */  bne       $v0, $v1, .L80026C7C
/* 2070 80026C70 00000000 */   nop
/* 2074 80026C74 0C049081 */  jal       render_messages
/* 2078 80026C78 00000000 */   nop
.L80026C7C:
/* 207C 80026C7C 0C00AEA0 */  jal       render_curtains
/* 2080 80026C80 00000000 */   nop
/* 2084 80026C84 8E220000 */  lw        $v0, 0x0($s1)
/* 2088 80026C88 3C030010 */  lui       $v1, (0x100000 >> 16)
/* 208C 80026C8C 00431024 */  and       $v0, $v0, $v1
/* 2090 80026C90 10400003 */  beqz      $v0, .L80026CA0
/* 2094 80026C94 00000000 */   nop
/* 2098 80026C98 0C049081 */  jal       render_messages
/* 209C 80026C9C 00000000 */   nop
.L80026CA0:
/* 20A0 80026CA0 8E220000 */  lw        $v0, 0x0($s1)
/* 20A4 80026CA4 3C030001 */  lui       $v1, (0x10000 >> 16)
/* 20A8 80026CA8 00431024 */  and       $v0, $v0, $v1
/* 20AC 80026CAC 10400003 */  beqz      $v0, .L80026CBC
/* 20B0 80026CB0 00000000 */   nop
/* 20B4 80026CB4 0C051EB1 */  jal       render_window_root
/* 20B8 80026CB8 00000000 */   nop
.L80026CBC:
/* 20BC 80026CBC 0C044BF1 */  jal       state_render_frontUI
/* 20C0 80026CC0 00000000 */   nop
/* 20C4 80026CC4 8E220000 */  lw        $v0, 0x0($s1)
/* 20C8 80026CC8 30420020 */  andi      $v0, $v0, 0x20
/* 20CC 80026CCC 10400010 */  beqz      $v0, .L80026D10
/* 20D0 80026CD0 00000000 */   nop
/* 20D4 80026CD4 3C038007 */  lui       $v1, %hi(D_800741A2)
/* 20D8 80026CD8 846341A2 */  lh        $v1, %lo(D_800741A2)($v1)
/* 20DC 80026CDC 28620002 */  slti      $v0, $v1, 0x2
/* 20E0 80026CE0 1040000B */  beqz      $v0, .L80026D10
/* 20E4 80026CE4 00000000 */   nop
/* 20E8 80026CE8 04600009 */  bltz      $v1, .L80026D10
/* 20EC 80026CEC 24040007 */   addiu    $a0, $zero, 0x7
/* 20F0 80026CF0 3C028007 */  lui       $v0, %hi(D_800741A0)
/* 20F4 80026CF4 844241A0 */  lh        $v0, %lo(D_800741A0)($v0)
/* 20F8 80026CF8 44820000 */  mtc1      $v0, $f0
/* 20FC 80026CFC 00000000 */  nop
/* 2100 80026D00 46800020 */  cvt.s.w   $f0, $f0
/* 2104 80026D04 44050000 */  mfc1      $a1, $f0
/* 2108 80026D08 0C04DAA0 */  jal       _render_transition_stencil
/* 210C 80026D0C 0000302D */   daddu    $a2, $zero, $zero
.L80026D10:
/* 2110 80026D10 3C02800A */  lui       $v0, %hi(gMainGfxPos)
/* 2114 80026D14 8C42A66C */  lw        $v0, %lo(gMainGfxPos)($v0)
/* 2118 80026D18 3C03800A */  lui       $v1, %hi(gDisplayContext)
/* 211C 80026D1C 8C63A674 */  lw        $v1, %lo(gDisplayContext)($v1)
/* 2120 80026D20 2442FDD0 */  addiu     $v0, $v0, -0x230
/* 2124 80026D24 00431023 */  subu      $v0, $v0, $v1
/* 2128 80026D28 000210C2 */  srl       $v0, $v0, 3
/* 212C 80026D2C 28422080 */  slti      $v0, $v0, 0x2080
/* 2130 80026D30 54400003 */  bnel      $v0, $zero, .L80026D40
/* 2134 80026D34 0000302D */   daddu    $a2, $zero, $zero
.L80026D38:
/* 2138 80026D38 08009B4E */  j         .L80026D38
/* 213C 80026D3C 00000000 */   nop
.L80026D40:
/* 2140 80026D40 3C070004 */  lui       $a3, (0x40001 >> 16)
/* 2144 80026D44 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* 2148 80026D48 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* 214C 80026D4C 34E70001 */  ori       $a3, $a3, (0x40001 & 0xFFFF)
/* 2150 80026D50 8D030000 */  lw        $v1, 0x0($t0)
/* 2154 80026D54 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 2158 80026D58 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 215C 80026D5C 0060482D */  daddu     $t1, $v1, $zero
/* 2160 80026D60 24630008 */  addiu     $v1, $v1, 0x8
/* 2164 80026D64 24440230 */  addiu     $a0, $v0, 0x230
/* 2168 80026D68 2465FDD8 */  addiu     $a1, $v1, -0x228
/* 216C 80026D6C 00A22823 */  subu      $a1, $a1, $v0
/* 2170 80026D70 000528C3 */  sra       $a1, $a1, 3
/* 2174 80026D74 000528C0 */  sll       $a1, $a1, 3
/* 2178 80026D78 3C02E900 */  lui       $v0, (0xE9000000 >> 16)
/* 217C 80026D7C AD030000 */  sw        $v1, 0x0($t0)
/* 2180 80026D80 AD220000 */  sw        $v0, 0x0($t1)
/* 2184 80026D84 24620008 */  addiu     $v0, $v1, 0x8
/* 2188 80026D88 AD200004 */  sw        $zero, 0x4($t1)
/* 218C 80026D8C AD020000 */  sw        $v0, 0x0($t0)
/* 2190 80026D90 3C02DF00 */  lui       $v0, (0xDF000000 >> 16)
/* 2194 80026D94 AC620000 */  sw        $v0, 0x0($v1)
/* 2198 80026D98 0C00B331 */  jal       nuGfxTaskStart
/* 219C 80026D9C AC600004 */   sw       $zero, 0x4($v1)
/* 21A0 80026DA0 24050140 */  addiu     $a1, $zero, 0x140
/* 21A4 80026DA4 240600F0 */  addiu     $a2, $zero, 0xF0
/* 21A8 80026DA8 3C038007 */  lui       $v1, %hi(gCurrentDisplayContextIndex)
/* 21AC 80026DAC 246341F4 */  addiu     $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 21B0 80026DB0 8C620000 */  lw        $v0, 0x0($v1)
/* 21B4 80026DB4 3C04800A */  lui       $a0, %hi(nuGfxCfb_ptr)
/* 21B8 80026DB8 8C84A64C */  lw        $a0, %lo(nuGfxCfb_ptr)($a0)
/* 21BC 80026DBC 38420001 */  xori      $v0, $v0, 0x1
/* 21C0 80026DC0 0C00B224 */  jal       crash_screen_set_draw_info
/* 21C4 80026DC4 AC620000 */   sw       $v0, 0x0($v1)
.L80026DC8:
/* 21C8 80026DC8 8FBF0018 */  lw        $ra, 0x18($sp)
/* 21CC 80026DCC 8FB10014 */  lw        $s1, 0x14($sp)
/* 21D0 80026DD0 8FB00010 */  lw        $s0, 0x10($sp)
/* 21D4 80026DD4 03E00008 */  jr        $ra
/* 21D8 80026DD8 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void gfx_draw_frame(void) {
    gMatrixListPos = 0;
    gMainGfxPos = &gDisplayContext->mainGfx[0];

    if (gOverrideFlags & GLOBAL_OVERRIDES_8) {
        gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
        return;
    }

    gSPMatrix(gMainGfxPos++, &MasterIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

    spr_render_init();

    if (!(gOverrideFlags & GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD)) {
        render_frame(FALSE);
    }

    player_render_interact_prompts();
    func_802C3EE4();
    render_screen_overlay_backUI();
    render_workers_backUI();
    render_hud_elements_backUI();
    render_effects_UI();
    state_render_backUI();

    if (!(gOverrideFlags & GLOBAL_OVERRIDES_WINDOWS_IN_FRONT_OF_CURTAINS)) {
        render_window_root();
    }

    if (!(gOverrideFlags & GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD) && !gGameStatusPtr->disableScripts) {
        render_frame(TRUE);
    }

    if (!(gOverrideFlags & (GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS | GLOBAL_OVERRIDES_10))) {
        render_messages();
    }

    render_workers_frontUI();
    render_hud_elements_frontUI();
    render_screen_overlay_frontUI();

    if ((gOverrideFlags & (GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS | GLOBAL_OVERRIDES_10)) == GLOBAL_OVERRIDES_10) {
        render_messages();
    }

    render_curtains();

    if (gOverrideFlags & GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS) {
        render_messages();
    }
    if (gOverrideFlags & GLOBAL_OVERRIDES_WINDOWS_IN_FRONT_OF_CURTAINS) {
        render_window_root();
    }

    state_render_frontUI();

    if (gOverrideFlags & GLOBAL_OVERRIDES_ENABLE_TRANSITION_STENCIL) {
        switch (D_800741A2) {
            case 0:
            case 1:
                _render_transition_stencil(7, D_800741A0, NULL);
                break;
        }
    }

    ASSERT((s32)(((u32)(gMainGfxPos - gDisplayContext->mainGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->mainGfx));

    gDPFullSync(gMainGfxPos++);
    gSPEndDisplayList(gMainGfxPos++);

    nuGfxTaskStart(gDisplayContext->mainGfx, (u32)(gMainGfxPos - gDisplayContext->mainGfx) * 8, NU_GFX_UCODE_F3DEX2,
                   NU_SC_TASK_LODABLE | NU_SC_SWAPBUFFER);
    gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
    crash_screen_set_draw_info(nuGfxCfb_ptr, SCREEN_WIDTH, SCREEN_HEIGHT);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80032970
/* DD70 80032970 44853000 */  mtc1      $a1, $f6
/* DD74 80032974 94820000 */  lhu       $v0, 0x0($a0)
/* DD78 80032978 8C830448 */  lw        $v1, 0x448($a0)
/* DD7C 8003297C 30421000 */  andi      $v0, $v0, 0x1000
/* DD80 80032980 10600005 */  beqz      $v1, .L80032998
/* DD84 80032984 0002302B */   sltu     $a2, $zero, $v0
/* DD88 80032988 8C630000 */  lw        $v1, 0x0($v1)
/* DD8C 8003298C 24020004 */  addiu     $v0, $zero, 0x4
/* DD90 80032990 50620001 */  beql      $v1, $v0, .L80032998
/* DD94 80032994 24060001 */   addiu    $a2, $zero, 0x1
.L80032998:
/* DD98 80032998 10C00008 */  beqz      $a2, .L800329BC
/* DD9C 8003299C 24020001 */   addiu    $v0, $zero, 0x1
/* DDA0 800329A0 44804000 */  mtc1      $zero, $f8
/* DDA4 800329A4 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* DDA8 800329A8 44810000 */  mtc1      $at, $f0
/* DDAC 800329AC AC82051C */  sw        $v0, 0x51C($a0)
/* DDB0 800329B0 E4800514 */  swc1      $f0, 0x514($a0)
/* DDB4 800329B4 0800CA8D */  j         .L80032A34
/* DDB8 800329B8 E4880510 */   swc1     $f8, 0x510($a0)
.L800329BC:
/* DDBC 800329BC 3C05800F */  lui       $a1, %hi(gPlayerStatusPtr)
/* DDC0 800329C0 8CA57B30 */  lw        $a1, %lo(gPlayerStatusPtr)($a1)
/* DDC4 800329C4 8CA20004 */  lw        $v0, 0x4($a1)
/* DDC8 800329C8 3C030040 */  lui       $v1, (0x400000 >> 16)
/* DDCC 800329CC 00431024 */  and       $v0, $v0, $v1
/* DDD0 800329D0 10400007 */  beqz      $v0, .L800329F0
/* DDD4 800329D4 00000000 */   nop
/* DDD8 800329D8 3C028011 */  lui       $v0, %hi(gPartnerStatus + 0x4)
/* DDDC 800329DC 8442EBB4 */  lh        $v0, %lo(gPartnerStatus + 0x4)($v0)
/* DDE0 800329E0 44824000 */  mtc1      $v0, $f8
/* DDE4 800329E4 00000000 */  nop
/* DDE8 800329E8 0800CA7E */  j         .L800329F8
/* DDEC 800329EC 46804220 */   cvt.s.w  $f8, $f8
.L800329F0:
/* DDF0 800329F0 C4A800E8 */  lwc1      $f8, 0xE8($a1)
/* DDF4 800329F4 46804220 */  cvt.s.w   $f8, $f8
.L800329F8:
/* DDF8 800329F8 44800000 */  mtc1      $zero, $f0
/* DDFC 800329FC 00000000 */  nop
/* DE00 80032A00 4608003C */  c.lt.s    $f0, $f8
/* DE04 80032A04 00000000 */  nop
/* DE08 80032A08 45000004 */  bc1f      .L80032A1C
/* DE0C 80032A0C 00000000 */   nop
/* DE10 80032A10 3C014248 */  lui       $at, (0x42480000 >> 16)
/* DE14 80032A14 44814000 */  mtc1      $at, $f8
/* DE18 80032A18 00000000 */  nop
.L80032A1C:
/* DE1C 80032A1C 4600403C */  c.lt.s    $f8, $f0
/* DE20 80032A20 00000000 */  nop
/* DE24 80032A24 45000003 */  bc1f      .L80032A34
/* DE28 80032A28 00000000 */   nop
/* DE2C 80032A2C 3C01C248 */  lui       $at, (0xC2480000 >> 16)
/* DE30 80032A30 44814000 */  mtc1      $at, $f8
.L80032A34:
/* DE34 80032A34 44801000 */  mtc1      $zero, $f2
/* DE38 80032A38 00000000 */  nop
/* DE3C 80032A3C 46024032 */  c.eq.s    $f8, $f2
/* DE40 80032A40 00000000 */  nop
/* DE44 80032A44 4501003A */  bc1t      .L80032B30
/* DE48 80032A48 00000000 */   nop
/* DE4C 80032A4C 4602403C */  c.lt.s    $f8, $f2
/* DE50 80032A50 00000000 */  nop
/* DE54 80032A54 4500001C */  bc1f      .L80032AC8
/* DE58 80032A58 00000000 */   nop
/* DE5C 80032A5C C4800518 */  lwc1      $f0, 0x518($a0)
/* DE60 80032A60 4600103C */  c.lt.s    $f2, $f0
/* DE64 80032A64 00000000 */  nop
/* DE68 80032A68 45020003 */  bc1fl     .L80032A78
/* DE6C 80032A6C 46080000 */   add.s    $f0, $f0, $f8
/* DE70 80032A70 0800CA9F */  j         .L80032A7C
/* DE74 80032A74 E4880518 */   swc1     $f8, 0x518($a0)
.L80032A78:
/* DE78 80032A78 E4800518 */  swc1      $f0, 0x518($a0)
.L80032A7C:
/* DE7C 80032A7C C4800518 */  lwc1      $f0, 0x518($a0)
/* DE80 80032A80 3C01C396 */  lui       $at, (0xC3960000 >> 16)
/* DE84 80032A84 44812000 */  mtc1      $at, $f4
/* DE88 80032A88 00000000 */  nop
/* DE8C 80032A8C 4604003E */  c.le.s    $f0, $f4
/* DE90 80032A90 00000000 */  nop
/* DE94 80032A94 45000026 */  bc1f      .L80032B30
/* DE98 80032A98 24020001 */   addiu    $v0, $zero, 0x1
/* DE9C 80032A9C C4800510 */  lwc1      $f0, 0x510($a0)
/* DEA0 80032AA0 44801000 */  mtc1      $zero, $f2
/* DEA4 80032AA4 00000000 */  nop
/* DEA8 80032AA8 4600103C */  c.lt.s    $f2, $f0
/* DEAC 80032AAC 00000000 */  nop
/* DEB0 80032AB0 45000002 */  bc1f      .L80032ABC
/* DEB4 80032AB4 AC82051C */   sw       $v0, 0x51C($a0)
/* DEB8 80032AB8 E4820514 */  swc1      $f2, 0x514($a0)
.L80032ABC:
/* DEBC 80032ABC 46003007 */  neg.s     $f0, $f6
/* DEC0 80032AC0 0800CACB */  j         .L80032B2C
/* DEC4 80032AC4 E4800510 */   swc1     $f0, 0x510($a0)
.L80032AC8:
/* DEC8 80032AC8 C4800518 */  lwc1      $f0, 0x518($a0)
/* DECC 80032ACC 4602003C */  c.lt.s    $f0, $f2
/* DED0 80032AD0 00000000 */  nop
/* DED4 80032AD4 45020003 */  bc1fl     .L80032AE4
/* DED8 80032AD8 46080000 */   add.s    $f0, $f0, $f8
/* DEDC 80032ADC 0800CABA */  j         .L80032AE8
/* DEE0 80032AE0 E4880518 */   swc1     $f8, 0x518($a0)
.L80032AE4:
/* DEE4 80032AE4 E4800518 */  swc1      $f0, 0x518($a0)
.L80032AE8:
/* DEE8 80032AE8 C4800518 */  lwc1      $f0, 0x518($a0)
/* DEEC 80032AEC 3C014396 */  lui       $at, (0x43960000 >> 16)
/* DEF0 80032AF0 44812000 */  mtc1      $at, $f4
/* DEF4 80032AF4 00000000 */  nop
/* DEF8 80032AF8 4600203E */  c.le.s    $f4, $f0
/* DEFC 80032AFC 00000000 */  nop
/* DF00 80032B00 4500000B */  bc1f      .L80032B30
/* DF04 80032B04 24020001 */   addiu    $v0, $zero, 0x1
/* DF08 80032B08 C4800510 */  lwc1      $f0, 0x510($a0)
/* DF0C 80032B0C 44801000 */  mtc1      $zero, $f2
/* DF10 80032B10 00000000 */  nop
/* DF14 80032B14 4602003C */  c.lt.s    $f0, $f2
/* DF18 80032B18 00000000 */  nop
/* DF1C 80032B1C 45000002 */  bc1f      .L80032B28
/* DF20 80032B20 AC82051C */   sw       $v0, 0x51C($a0)
/* DF24 80032B24 E4820514 */  swc1      $f2, 0x514($a0)
.L80032B28:
/* DF28 80032B28 E4860510 */  swc1      $f6, 0x510($a0)
.L80032B2C:
/* DF2C 80032B2C E4840518 */  swc1      $f4, 0x518($a0)
.L80032B30:
/* DF30 80032B30 8C82051C */  lw        $v0, 0x51C($a0)
/* DF34 80032B34 1040000F */  beqz      $v0, .L80032B74
/* DF38 80032B38 00000000 */   nop
/* DF3C 80032B3C C4800514 */  lwc1      $f0, 0x514($a0)
/* DF40 80032B40 3C013C23 */  lui       $at, (0x3C23D70A >> 16)
/* DF44 80032B44 3421D70A */  ori       $at, $at, (0x3C23D70A & 0xFFFF)
/* DF48 80032B48 44811000 */  mtc1      $at, $f2
/* DF4C 80032B4C 00000000 */  nop
/* DF50 80032B50 46020000 */  add.s     $f0, $f0, $f2
/* DF54 80032B54 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* DF58 80032B58 44811000 */  mtc1      $at, $f2
/* DF5C 80032B5C 00000000 */  nop
/* DF60 80032B60 4600103C */  c.lt.s    $f2, $f0
/* DF64 80032B64 00000000 */  nop
/* DF68 80032B68 45000002 */  bc1f      .L80032B74
/* DF6C 80032B6C E4800514 */   swc1     $f0, 0x514($a0)
/* DF70 80032B70 E4820514 */  swc1      $f2, 0x514($a0)
.L80032B74:
/* DF74 80032B74 C4800510 */  lwc1      $f0, 0x510($a0)
/* DF78 80032B78 C482050C */  lwc1      $f2, 0x50C($a0)
/* DF7C 80032B7C 46020001 */  sub.s     $f0, $f0, $f2
/* DF80 80032B80 44805000 */  mtc1      $zero, $f10
/* DF84 80032B84 00000000 */  nop
/* DF88 80032B88 460A0032 */  c.eq.s    $f0, $f10
/* DF8C 80032B8C 00000000 */  nop
/* DF90 80032B90 45000003 */  bc1f      .L80032BA0
/* DF94 80032B94 00000000 */   nop
/* DF98 80032B98 E48A0514 */  swc1      $f10, 0x514($a0)
/* DF9C 80032B9C AC80051C */  sw        $zero, 0x51C($a0)
.L80032BA0:
/* DFA0 80032BA0 C4800510 */  lwc1      $f0, 0x510($a0)
/* DFA4 80032BA4 C482050C */  lwc1      $f2, 0x50C($a0)
/* DFA8 80032BA8 46020101 */  sub.s     $f4, $f0, $f2
/* DFAC 80032BAC C4800514 */  lwc1      $f0, 0x514($a0)
/* DFB0 80032BB0 46002182 */  mul.s     $f6, $f4, $f0
/* DFB4 80032BB4 00000000 */  nop
/* DFB8 80032BB8 4604503C */  c.lt.s    $f10, $f4
/* DFBC 80032BBC 00000000 */  nop
/* DFC0 80032BC0 4500000D */  bc1f      .L80032BF8
/* DFC4 80032BC4 46002021 */   cvt.d.s  $f0, $f4
/* DFC8 80032BC8 3C01800A */  lui       $at, %hi(D_80098280)
/* DFCC 80032BCC D4228280 */  ldc1      $f2, %lo(D_80098280)($at)
/* DFD0 80032BD0 4622003C */  c.lt.d    $f0, $f2
/* DFD4 80032BD4 00000000 */  nop
/* DFD8 80032BD8 45030001 */  bc1tl     .L80032BE0
/* DFDC 80032BDC 46002186 */   mov.s    $f6, $f4
.L80032BE0:
/* DFE0 80032BE0 3C014040 */  lui       $at, (0x40400000 >> 16)
/* DFE4 80032BE4 44810000 */  mtc1      $at, $f0
/* DFE8 80032BE8 00000000 */  nop
/* DFEC 80032BEC 4606003C */  c.lt.s    $f0, $f6
/* DFF0 80032BF0 0800CB09 */  j         .L80032C24
/* DFF4 80032BF4 00000000 */   nop
.L80032BF8:
/* DFF8 80032BF8 3C01800A */  lui       $at, %hi(D_80098288)
/* DFFC 80032BFC D4228288 */  ldc1      $f2, %lo(D_80098288)($at)
/* E000 80032C00 4620103C */  c.lt.d    $f2, $f0
/* E004 80032C04 00000000 */  nop
/* E008 80032C08 45030001 */  bc1tl     .L80032C10
/* E00C 80032C0C 46002186 */   mov.s    $f6, $f4
.L80032C10:
/* E010 80032C10 3C01C040 */  lui       $at, (0xC0400000 >> 16)
/* E014 80032C14 44810000 */  mtc1      $at, $f0
/* E018 80032C18 00000000 */  nop
/* E01C 80032C1C 4600303C */  c.lt.s    $f6, $f0
/* E020 80032C20 00000000 */  nop
.L80032C24:
/* E024 80032C24 45030001 */  bc1tl     .L80032C2C
/* E028 80032C28 46000186 */   mov.s    $f6, $f0
.L80032C2C:
/* E02C 80032C2C 44800000 */  mtc1      $zero, $f0
/* E030 80032C30 00000000 */  nop
/* E034 80032C34 46004032 */  c.eq.s    $f8, $f0
/* E038 80032C38 00000000 */  nop
/* E03C 80032C3C 45000003 */  bc1f      .L80032C4C
/* E040 80032C40 00000000 */   nop
/* E044 80032C44 10C00005 */  beqz      $a2, .L80032C5C
/* E048 80032C48 00000000 */   nop
.L80032C4C:
/* E04C 80032C4C C480050C */  lwc1      $f0, 0x50C($a0)
/* E050 80032C50 46060000 */  add.s     $f0, $f0, $f6
/* E054 80032C54 03E00008 */  jr        $ra
/* E058 80032C58 E480050C */   swc1     $f0, 0x50C($a0)
.L80032C5C:
/* E05C 80032C5C 03E00008 */  jr        $ra
/* E060 80032C60 E4800514 */   swc1     $f0, 0x514($a0)

### DECOMPILED C INSTRUCTIONS:

void func_80032970(Camera* camera, f32 arg1) {
    f32 stickX;
    f32 deltaLeadAmount;
    s32 flags = camera->flags & CAMERA_FLAG_1000;
    s32 a2 = flags != 0;

    if (camera->currentController != NULL && camera->currentController->type == CAM_CONTROL_FIXED_POS_AND_ORIENTATION) {
        a2 = TRUE;
    }

    if (a2) {
        stickX = 0.0f;
        camera->unk_51C = TRUE;
        camera->unk_514 = 1.0f;
        camera->unk_510 = 0.0f;
    } else {
        if (gPlayerStatusPtr->animFlags & PA_FLAG_RIDING_PARTNER) {
            stickX = gPartnerStatus.stickX;
        } else {
            stickX = gPlayerStatusPtr->stickAxis[0];
        }
        if (stickX > 0.0f) {
            stickX = 50.0f;
        }
        if (stickX < 0.0f) {
            stickX = -50.0f;
        }
    }

    if (stickX != 0.0f) {
        if (stickX < 0.0f) {
            if (camera->unk_518 > 0.0f) {
                camera->unk_518 = stickX;
            } else {
                camera->unk_518 += stickX;
            }
            if (camera->unk_518 <= -300.0f) {
                camera->unk_51C = TRUE;
                if (camera->unk_510 > 0.0f) {
                    camera->unk_514 = 0.0f;
                }
                camera->unk_510 = -arg1;
                camera->unk_518 = -300.0f;
            }
        } else {
            if (camera->unk_518 < 0.0f) {
                camera->unk_518 = stickX;
            } else {
                camera->unk_518 += stickX;
            }
            if (camera->unk_518 >= 300.0f) {
                camera->unk_51C = TRUE;
                if (camera->unk_510 < 0.0f) {
                    camera->unk_514 = 0.0f;
                }
                camera->unk_510 = arg1;
                camera->unk_518 = 300.0f;
            }
        }
    }

    if (camera->unk_51C) {
        camera->unk_514 += 0.01f;
        if (camera->unk_514 > 1.0f) {
            camera->unk_514 = 1.0f;
        }
    }

    if (camera->unk_510 - camera->leadAmount == 0.0f) {
        camera->unk_514 = 0.0f;
        camera->unk_51C = FALSE;
    }

    deltaLeadAmount = (camera->unk_510 - camera->leadAmount) * camera->unk_514;
    if (camera->unk_510 - camera->leadAmount > 0.0f) {
        if (camera->unk_510 - camera->leadAmount < 0.1) {
            deltaLeadAmount = camera->unk_510 - camera->leadAmount;
        }
        if (deltaLeadAmount > 3.0f) {
            deltaLeadAmount = 3.0f;
        }
    } else {
        if (camera->unk_510 - camera->leadAmount > -0.1) {
            deltaLeadAmount = camera->unk_510 - camera->leadAmount;
        }
        if (deltaLeadAmount < -3.0f) {
            deltaLeadAmount = -3.0f;
        }
    }

    if (stickX != 0.0f || a2) {
        camera->leadAmount += deltaLeadAmount;
    } else {
        camera->unk_514 = 0.0f;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel appendGfx_ispy_icon
/* E225B0 802B7000 3C028011 */  lui       $v0, %hi(gPlayerStatus + 0x4)
/* E225B4 802B7004 8C42EFCC */  lw        $v0, %lo(gPlayerStatus + 0x4)($v0)
/* E225B8 802B7008 27BDFF30 */  addiu     $sp, $sp, -0xD0
/* E225BC 802B700C AFBF00C8 */  sw        $ra, 0xC8($sp)
/* E225C0 802B7010 AFB300C4 */  sw        $s3, 0xC4($sp)
/* E225C4 802B7014 AFB200C0 */  sw        $s2, 0xC0($sp)
/* E225C8 802B7018 AFB100BC */  sw        $s1, 0xBC($sp)
/* E225CC 802B701C 30420100 */  andi      $v0, $v0, 0x100
/* E225D0 802B7020 104000A0 */  beqz      $v0, .L802B72A4
/* E225D4 802B7024 AFB000B8 */   sw       $s0, 0xB8($sp)
/* E225D8 802B7028 3C13802B */  lui       $s3, %hi(ISpyPtr)
/* E225DC 802B702C 26737C78 */  addiu     $s3, $s3, %lo(ISpyPtr)
/* E225E0 802B7030 8E620000 */  lw        $v0, 0x0($s3)
/* E225E4 802B7034 27A40020 */  addiu     $a0, $sp, 0x20
/* E225E8 802B7038 8C45000C */  lw        $a1, 0xC($v0)
.L802B703C:
/* E225EC 802B703C 3C120001 */  lui       $s2, (0x11630 >> 16)
/* E225F0 802B7040 00A0302D */  daddu     $a2, $a1, $zero
.L802B7044:
/* E225F4 802B7044 0C019DF0 */  jal       guScaleF
/* E225F8 802B7048 00A0382D */   daddu    $a3, $a1, $zero
glabel should_continue_pulse_stone
/* E225FC 802B704C 27B00060 */  addiu     $s0, $sp, 0x60
/* E22600 802B7050 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* E22604 802B7054 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* E22608 802B7058 44800000 */  mtc1      $zero, $f0
/* E2260C 802B705C 00031080 */  sll       $v0, $v1, 2
/* E22610 802B7060 00431021 */  addu      $v0, $v0, $v1
/* E22614 802B7064 00021080 */  sll       $v0, $v0, 2
/* E22618 802B7068 00431023 */  subu      $v0, $v0, $v1
.L802B706C:
/* E2261C 802B706C 000218C0 */  sll       $v1, $v0, 3
/* E22620 802B7070 00431021 */  addu      $v0, $v0, $v1
/* E22624 802B7074 000210C0 */  sll       $v0, $v0, 3
/* E22628 802B7078 44060000 */  mfc1      $a2, $f0
/* E2262C 802B707C 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* E22630 802B7080 00220821 */  addu      $at, $at, $v0
/* E22634 802B7084 C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* E22638 802B7088 3C073F80 */  lui       $a3, (0x3F800000 >> 16)
/* E2263C 802B708C 46000007 */  neg.s     $f0, $f0
/* E22640 802B7090 44050000 */  mfc1      $a1, $f0
/* E22644 802B7094 0200202D */  daddu     $a0, $s0, $zero
/* E22648 802B7098 0C019EC8 */  jal       guRotateF
.L802B709C:
/* E2264C 802B709C AFA60010 */   sw       $a2, 0x10($sp)
/* E22650 802B70A0 27A40020 */  addiu     $a0, $sp, 0x20
/* E22654 802B70A4 0200282D */  daddu     $a1, $s0, $zero
/* E22658 802B70A8 0C019D80 */  jal       guMtxCatF
.L802B70AC:
/* E2265C 802B70AC 0080302D */   daddu    $a2, $a0, $zero
/* E22660 802B70B0 8E620000 */  lw        $v0, 0x0($s3)
glabel interact_speech_setup
/* E22664 802B70B4 36521630 */  ori       $s2, $s2, (0x11630 & 0xFFFF)
/* E22668 802B70B8 8C450000 */  lw        $a1, 0x0($v0)
/* E2266C 802B70BC 8C460004 */  lw        $a2, 0x4($v0)
/* E22670 802B70C0 8C470008 */  lw        $a3, 0x8($v0)
/* E22674 802B70C4 0C019E40 */  jal       guTranslateF
/* E22678 802B70C8 0200202D */   daddu    $a0, $s0, $zero
/* E2267C 802B70CC 27A40020 */  addiu     $a0, $sp, 0x20
/* E22680 802B70D0 0200282D */  daddu     $a1, $s0, $zero
/* E22684 802B70D4 0C019D80 */  jal       guMtxCatF
/* E22688 802B70D8 0200302D */   daddu    $a2, $s0, $zero
/* E2268C 802B70DC 0200202D */  daddu     $a0, $s0, $zero
/* E22690 802B70E0 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* E22694 802B70E4 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* E22698 802B70E8 3C11800A */  lui       $s1, %hi(gDisplayContext)
/* E2269C 802B70EC 2631A674 */  addiu     $s1, $s1, %lo(gDisplayContext)
/* E226A0 802B70F0 96050000 */  lhu       $a1, 0x0($s0)
/* E226A4 802B70F4 8E220000 */  lw        $v0, 0x0($s1)
/* E226A8 802B70F8 00052980 */  sll       $a1, $a1, 6
/* E226AC 802B70FC 00B22821 */  addu      $a1, $a1, $s2
/* E226B0 802B7100 0C019D40 */  jal       guMtxF2L
.L802B7104:
/* E226B4 802B7104 00452821 */   addu     $a1, $v0, $a1
/* E226B8 802B7108 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* E226BC 802B710C 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* E226C0 802B7110 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* E226C4 802B7114 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* E226C8 802B7118 8CA40000 */  lw        $a0, 0x0($a1)
/* E226CC 802B711C 96020000 */  lhu       $v0, 0x0($s0)
/* E226D0 802B7120 0080302D */  daddu     $a2, $a0, $zero
/* E226D4 802B7124 24840008 */  addiu     $a0, $a0, 0x8
/* E226D8 802B7128 ACA40000 */  sw        $a0, 0x0($a1)
/* E226DC 802B712C ACC30000 */  sw        $v1, 0x0($a2)
.L802B7130:
/* E226E0 802B7130 24430001 */  addiu     $v1, $v0, 0x1
/* E226E4 802B7134 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* E226E8 802B7138 00021180 */  sll       $v0, $v0, 6
/* E226EC 802B713C A6030000 */  sh        $v1, 0x0($s0)
pulse_stone_notification_setup:
/* E226F0 802B7140 8E230000 */  lw        $v1, 0x0($s1)
.L802B7144:
/* E226F4 802B7144 00521021 */  addu      $v0, $v0, $s2
/* E226F8 802B7148 00621821 */  addu      $v1, $v1, $v0
/* E226FC 802B714C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* E22700 802B7150 ACC30004 */  sw        $v1, 0x4($a2)
/* E22704 802B7154 AC820000 */  sw        $v0, 0x0($a0)
/* E22708 802B7158 8E630000 */  lw        $v1, 0x0($s3)
/* E2270C 802B715C 3C02802B */  lui       $v0, %hi(ispy_icon_gfx)
/* E22710 802B7160 24427C00 */  addiu     $v0, $v0, %lo(ispy_icon_gfx)
/* E22714 802B7164 AC820004 */  sw        $v0, 0x4($a0)
/* E22718 802B7168 8C620018 */  lw        $v0, 0x18($v1)
/* E2271C 802B716C 24840008 */  addiu     $a0, $a0, 0x8
/* E22720 802B7170 2842002F */  slti      $v0, $v0, 0x2F
/* E22724 802B7174 10400004 */  beqz      $v0, .L802B7188
/* E22728 802B7178 ACA40000 */   sw       $a0, 0x0($a1)
/* E2272C 802B717C 8C620020 */  lw        $v0, 0x20($v1)
/* E22730 802B7180 24420001 */  addiu     $v0, $v0, 0x1
/* E22734 802B7184 AC620020 */  sw        $v0, 0x20($v1)
.L802B7188:
/* E22738 802B7188 8E620000 */  lw        $v0, 0x0($s3)
/* E2273C 802B718C 3C032AAA */  lui       $v1, (0x2AAAAAAB >> 16)
/* E22740 802B7190 8C440020 */  lw        $a0, 0x20($v0)
/* E22744 802B7194 3463AAAB */  ori       $v1, $v1, (0x2AAAAAAB & 0xFFFF)
/* E22748 802B7198 00830018 */  mult      $a0, $v1
/* E2274C 802B719C 000417C3 */  sra       $v0, $a0, 31
/* E22750 802B71A0 00004010 */  mfhi      $t0
/* E22754 802B71A4 00081843 */  sra       $v1, $t0, 1
/* E22758 802B71A8 00621823 */  subu      $v1, $v1, $v0
/* E2275C 802B71AC 00031040 */  sll       $v0, $v1, 1
/* E22760 802B71B0 00431021 */  addu      $v0, $v0, $v1
/* E22764 802B71B4 00021080 */  sll       $v0, $v0, 2
/* E22768 802B71B8 00822023 */  subu      $a0, $a0, $v0
/* E2276C 802B71BC 2C82000C */  sltiu     $v0, $a0, 0xC
/* E22770 802B71C0 10400011 */  beqz      $v0, .L802B7208
/* E22774 802B71C4 00041080 */   sll      $v0, $a0, 2
glabel appendGfx_speech_bubble
/* E22778 802B71C8 3C01802B */  lui       $at, %hi(D_802B7C80)
/* E2277C 802B71CC 00220821 */  addu      $at, $at, $v0
/* E22780 802B71D0 8C227C80 */  lw        $v0, %lo(D_802B7C80)($at)
glabel appendGfx_pulse_stone_icon
/* E22784 802B71D4 00400008 */  jr        $v0
/* E22788 802B71D8 00000000 */   nop
/* E2278C 802B71DC 3C02802B */  lui       $v0, %hi(ispy_icon_1_pal)
/* E22790 802B71E0 24427BA0 */  addiu     $v0, $v0, %lo(ispy_icon_1_pal)
/* E22794 802B71E4 080ADC82 */  j         .L802B7208
glabel appendGfx_interact_prompt
/* E22798 802B71E8 AFA200A4 */   sw       $v0, 0xA4($sp)
/* E2279C 802B71EC 3C02802B */  lui       $v0, %hi(ispy_icon_2_pal)
/* E227A0 802B71F0 24427BC0 */  addiu     $v0, $v0, %lo(ispy_icon_2_pal)
/* E227A4 802B71F4 080ADC82 */  j         .L802B7208
/* E227A8 802B71F8 AFA200A4 */   sw       $v0, 0xA4($sp)
/* E227AC 802B71FC 3C02802B */  lui       $v0, %hi(ispy_icon_3_pal)
/* E227B0 802B7200 24427BE0 */  addiu     $v0, $v0, %lo(ispy_icon_3_pal)
/* E227B4 802B7204 AFA200A4 */  sw        $v0, 0xA4($sp)
.L802B7208:
/* E227B8 802B7208 0000202D */  daddu     $a0, $zero, $zero
/* E227BC 802B720C 24050007 */  addiu     $a1, $zero, 0x7
/* E227C0 802B7210 240600FF */  addiu     $a2, $zero, 0xFF
/* E227C4 802B7214 3C02802B */  lui       $v0, %hi(ISpyPtr)
/* E227C8 802B7218 8C427C78 */  lw        $v0, %lo(ISpyPtr)($v0)
/* E227CC 802B721C 00C0802D */  daddu     $s0, $a2, $zero
/* E227D0 802B7220 AFB00010 */  sw        $s0, 0x10($sp)
/* E227D4 802B7224 8C420028 */  lw        $v0, 0x28($v0)
/* E227D8 802B7228 00C0382D */  daddu     $a3, $a2, $zero
/* E227DC 802B722C AFA00018 */  sw        $zero, 0x18($sp)
/* E227E0 802B7230 0C04EAA7 */  jal       imgfx_update
/* E227E4 802B7234 AFA20014 */   sw       $v0, 0x14($sp)
/* E227E8 802B7238 0000202D */  daddu     $a0, $zero, $zero
/* E227EC 802B723C 27A500A0 */  addiu     $a1, $sp, 0xA0
/* E227F0 802B7240 0080302D */  daddu     $a2, $a0, $zero
/* E227F4 802B7244 27A70060 */  addiu     $a3, $sp, 0x60
/* E227F8 802B7248 3C02802B */  lui       $v0, %hi(ispy_icon_img)
/* E227FC 802B724C 24427580 */  addiu     $v0, $v0, %lo(ispy_icon_img)
/* E22800 802B7250 AFA200A0 */  sw        $v0, 0xA0($sp)
/* E22804 802B7254 24020038 */  addiu     $v0, $zero, 0x38
/* E22808 802B7258 A7A200A8 */  sh        $v0, 0xA8($sp)
/* E2280C 802B725C A7A200AA */  sh        $v0, 0xAA($sp)
/* E22810 802B7260 2402FFE4 */  addiu     $v0, $zero, -0x1C
/* E22814 802B7264 A7A200AC */  sh        $v0, 0xAC($sp)
/* E22818 802B7268 2402002E */  addiu     $v0, $zero, 0x2E
/* E2281C 802B726C A7A200AE */  sh        $v0, 0xAE($sp)
/* E22820 802B7270 0C04EBDC */  jal       imgfx_appendGfx_component
/* E22824 802B7274 A3B000B0 */   sb       $s0, 0xB0($sp)
/* E22828 802B7278 3C05D838 */  lui       $a1, (0xD8380002 >> 16)
/* E2282C 802B727C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* E22830 802B7280 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* E22834 802B7284 8C620000 */  lw        $v0, 0x0($v1)
/* E22838 802B7288 34A50002 */  ori       $a1, $a1, (0xD8380002 & 0xFFFF)
/* E2283C 802B728C 0040202D */  daddu     $a0, $v0, $zero
/* E22840 802B7290 24420008 */  addiu     $v0, $v0, 0x8
/* E22844 802B7294 AC620000 */  sw        $v0, 0x0($v1)
/* E22848 802B7298 24020040 */  addiu     $v0, $zero, 0x40
/* E2284C 802B729C AC850000 */  sw        $a1, 0x0($a0)
/* E22850 802B72A0 AC820004 */  sw        $v0, 0x4($a0)
.L802B72A4:
/* E22854 802B72A4 8FBF00C8 */  lw        $ra, 0xC8($sp)
/* E22858 802B72A8 8FB300C4 */  lw        $s3, 0xC4($sp)
/* E2285C 802B72AC 8FB200C0 */  lw        $s2, 0xC0($sp)
/* E22860 802B72B0 8FB100BC */  lw        $s1, 0xBC($sp)
/* E22864 802B72B4 8FB000B8 */  lw        $s0, 0xB8($sp)
/* E22868 802B72B8 03E00008 */  jr        $ra
/* E2286C 802B72BC 27BD00D0 */   addiu    $sp, $sp, 0xD0

### DECOMPILED C INSTRUCTIONS:

void appendGfx_ispy_icon(void) {
    Matrix4f matrix1;
    Matrix4f matrix2;
    ImgFXTexture ifxImg;
    s32 flashPhase;

    if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE) {
        guScaleF(matrix1, ISpyPtr->scale, ISpyPtr->scale, ISpyPtr->scale);
        guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
        guMtxCatF(matrix1, matrix2, matrix1);
        guTranslateF(matrix2, ISpyPtr->pos.x, ISpyPtr->pos.y, ISpyPtr->pos.z);
        guMtxCatF(matrix1, matrix2, matrix2);
        guMtxF2L(matrix2, &gDisplayContext->matrixStack[gMatrixListPos]);

        gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 3);
        gSPDisplayList(gMainGfxPos++, ispy_icon_gfx);

        if (ISpyPtr->time < 47) {
            ISpyPtr->flashCount++;
        }

        flashPhase = ISpyPtr->flashCount;
        flashPhase = flashPhase % 12;
        switch (flashPhase) {
            case 0:
            case 1:
            case 2:
            case 3:
                ifxImg.palette = ispy_icon_1_pal;
                break;
            case 4:
            case 5:
            case 6:
            case 7:
                ifxImg.palette = ispy_icon_2_pal;
                break;
            case 8:
            case 9:
            case 10:
            case 11:
                ifxImg.palette = ispy_icon_3_pal;
                break;
        }
        imgfx_update(0, IMGFX_SET_ALPHA, 255, 255, 255, ISpyPtr->alpha, 0);

        ifxImg.raster = ispy_icon_img;
        ifxImg.width  = ispy_icon_img_width;
        ifxImg.height = ispy_icon_img_height;
        ifxImg.xOffset = -28;
        ifxImg.yOffset = 46;
        ifxImg.alpha = 255;

        imgfx_appendGfx_component(0, &ifxImg, 0, matrix2);
        gSPPopMatrix(gMainGfxPos++, 0);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel D_80242F68
/* 1637C8 80242F68 3C0A8025 */  lui       $t2, %hi(D_80249B94)
glabel func_80242F6C
/* 1637CC 80242F6C 254A9B94 */  addiu     $t2, $t2, %lo(D_80249B94)
glabel func_80242F70
/* 1637D0 80242F70 3C058025 */  lui       $a1, %hi(D_80249BA0)
glabel func_80242F74
/* 1637D4 80242F74 8CA59BA0 */  lw        $a1, %lo(D_80249BA0)($a1)
.L80242F78:
/* 1637D8 80242F78 8D430000 */  lw        $v1, 0x0($t2)
glabel func_80242F7C
/* 1637DC 80242F7C 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
.L80242F80:
/* 1637E0 80242F80 44812800 */  mtc1      $at, $f5
.L80242F84:
/* 1637E4 80242F84 44802000 */  mtc1      $zero, $f4
D_80242F88:
/* 1637E8 80242F88 00A31023 */  subu      $v0, $a1, $v1
.L80242F8C:
/* 1637EC 80242F8C 44821000 */  mtc1      $v0, $f2
D_80242F90:
/* 1637F0 80242F90 00000000 */  nop
glabel func_80242F94
/* 1637F4 80242F94 468010A1 */  cvt.d.w   $f2, $f2
glabel func_80242F98
/* 1637F8 80242F98 46241082 */  mul.d     $f2, $f2, $f4
glabel dead_kzn_17_UnkFunc49
/* 1637FC 80242F9C 00000000 */  nop
glabel func_80242FA0
/* 163800 80242FA0 3C098025 */  lui       $t1, %hi(D_80249B98)
glabel func_80242FA4
/* 163804 80242FA4 25299B98 */  addiu     $t1, $t1, %lo(D_80249B98)
.L80242FA8:
/* 163808 80242FA8 3C048025 */  lui       $a0, %hi(D_80249BA4)
glabel func_80242FAC
/* 16380C 80242FAC 8C849BA4 */  lw        $a0, %lo(D_80249BA4)($a0)
D_80242FB0:
/* 163810 80242FB0 8D260000 */  lw        $a2, 0x0($t1)
D_80242FB4:
/* 163814 80242FB4 00861023 */  subu      $v0, $a0, $a2
glabel func_80242FB8
/* 163818 80242FB8 44820000 */  mtc1      $v0, $f0
glabel func_80242FBC
/* 16381C 80242FBC 00000000 */  nop
.L80242FC0:
/* 163820 80242FC0 46800021 */  cvt.d.w   $f0, $f0
.L80242FC4:
/* 163824 80242FC4 46240002 */  mul.d     $f0, $f0, $f4
glabel func_80242FC8
/* 163828 80242FC8 00000000 */  nop
D_80242FCC:
/* 16382C 80242FCC 4620118D */  trunc.w.d $f6, $f2
D_80242FD0:
/* 163830 80242FD0 44073000 */  mfc1      $a3, $f6
glabel func_80242FD4
/* 163834 80242FD4 4620018D */  trunc.w.d $f6, $f0
glabel func_80242FD8
/* 163838 80242FD8 44083000 */  mfc1      $t0, $f6
glabel func_80242FDC
/* 16383C 80242FDC 14A30003 */  bne       $a1, $v1, .L80242FEC
D_80242FE0:
/* 163840 80242FE0 00000000 */   nop
glabel func_80242FE4
/* 163844 80242FE4 10860007 */  beq       $a0, $a2, func_80243004
D_80242FE8:
/* 163848 80242FE8 00000000 */   nop
.L80242FEC:
/* 16384C 80242FEC 14E00005 */  bnez      $a3, func_80243004
D_80242FF0:
/* 163850 80242FF0 00000000 */   nop
glabel func_80242FF4
/* 163854 80242FF4 15000003 */  bnez      $t0, func_80243004
D_80242FF8:
/* 163858 80242FF8 00000000 */   nop
.L80242FFC:
/* 16385C 80242FFC AD450000 */  sw        $a1, 0x0($t2)
glabel func_80243000
/* 163860 80243000 AD240000 */  sw        $a0, 0x0($t1)
glabel func_80243004
/* 163864 80243004 3C038025 */  lui       $v1, %hi(D_80249B94)
D_80243008:
/* 163868 80243008 24639B94 */  addiu     $v1, $v1, %lo(D_80249B94)
D_8024300C:
/* 16386C 8024300C 8C620000 */  lw        $v0, 0x0($v1)
D_80243010:
/* 163870 80243010 00471021 */  addu      $v0, $v0, $a3
glabel func_80243014
/* 163874 80243014 AC620000 */  sw        $v0, 0x0($v1)
glabel func_80243018
/* 163878 80243018 3C038025 */  lui       $v1, %hi(D_80249B98)
glabel func_8024301C
/* 16387C 8024301C 24639B98 */  addiu     $v1, $v1, %lo(D_80249B98)
.L80243020:
/* 163880 80243020 8C620000 */  lw        $v0, 0x0($v1)
/* 163884 80243024 3C048025 */  lui       $a0, %hi(D_80249BA8)
D_80243028:
/* 163888 80243028 8C849BA8 */  lw        $a0, %lo(D_80249BA8)($a0)
.L8024302C:
/* 16388C 8024302C 00481021 */  addu      $v0, $v0, $t0
.L80243030:
/* 163890 80243030 14800009 */  bnez      $a0, func_80243058
glabel func_80243034
/* 163894 80243034 AC620000 */   sw       $v0, 0x0($v1)
glabel func_80243038
/* 163898 80243038 3C038025 */  lui       $v1, %hi(D_80249B9C)
D_8024303C:
/* 16389C 8024303C 24639B9C */  addiu     $v1, $v1, %lo(D_80249B9C)
glabel func_80243040
/* 1638A0 80243040 8C620000 */  lw        $v0, 0x0($v1)
glabel func_80243044
/* 1638A4 80243044 2442FF80 */  addiu     $v0, $v0, -0x80
glabel func_80243048
/* 1638A8 80243048 0441000D */  bgez      $v0, D_80243080
D_8024304C:
/* 1638AC 8024304C AC620000 */   sw       $v0, 0x0($v1)
glabel func_80243050
/* 1638B0 80243050 08090C20 */  j         D_80243080
glabel func_80243054_EA3954
/* 1638B4 80243054 AC600000 */   sw       $zero, 0x0($v1)
glabel func_80243058
/* 1638B8 80243058 3C038025 */  lui       $v1, %hi(D_80249B9C)
D_8024305C:
/* 1638BC 8024305C 24639B9C */  addiu     $v1, $v1, %lo(D_80249B9C)
.L80243060:
/* 1638C0 80243060 8C620000 */  lw        $v0, 0x0($v1)
.L80243064:
/* 1638C4 80243064 24420020 */  addiu     $v0, $v0, 0x20
glabel func_80243068
/* 1638C8 80243068 AC620000 */  sw        $v0, 0x0($v1)
.L8024306C:
/* 1638CC 8024306C 28420100 */  slti      $v0, $v0, 0x100
glabel func_80243070
/* 1638D0 80243070 14400004 */  bnez      $v0, func_80243084
.L80243074:
/* 1638D4 80243074 2404002C */   addiu    $a0, $zero, 0x2C
D_80243078:
/* 1638D8 80243078 240200FF */  addiu     $v0, $zero, 0xFF
/* 1638DC 8024307C AC620000 */  sw        $v0, 0x0($v1)
D_80243080:
/* 1638E0 80243080 2404002C */  addiu     $a0, $zero, 0x2C
glabel func_80243084
/* 1638E4 80243084 2406FFFF */  addiu     $a2, $zero, -0x1
D_80243088:
/* 1638E8 80243088 0080282D */  daddu     $a1, $a0, $zero
D_8024308C:
/* 1638EC 8024308C 3C038016 */  lui       $v1, %hi(D_8015A2D0)
D_80243090:
/* 1638F0 80243090 2463A2D0 */  addiu     $v1, $v1, %lo(D_8015A2D0)
glabel func_80243094
/* 1638F4 80243094 80620003 */  lb        $v0, 0x3($v1)
D_80243098:
/* 1638F8 80243098 10460003 */  beq       $v0, $a2, func_802430A8
D_8024309C:
/* 1638FC 8024309C 00000000 */   nop
D_802430A0:
/* 163900 802430A0 54450006 */  bnel      $v0, $a1, dead_flo_08_ItemChoice_SelectedItemID
.L802430A4:
/* 163904 802430A4 24840001 */   addiu    $a0, $a0, 0x1
glabel func_802430A8
/* 163908 802430A8 90620000 */  lbu       $v0, 0x0($v1)
.L802430AC:
/* 16390C 802430AC 30420008 */  andi      $v0, $v0, 0x8
D_802430B0:
/* 163910 802430B0 14400005 */  bnez      $v0, func_802430C8
glabel func_802430B4
/* 163914 802430B4 00000000 */   nop
dead_flo_08_ItemChoice_HasSelectedItem:
/* 163918 802430B8 24840001 */  addiu     $a0, $a0, 0x1
dead_flo_08_ItemChoice_SelectedItemID:
/* 16391C 802430BC 28820040 */  slti      $v0, $a0, 0x40
glabel func_802430C0
/* 163920 802430C0 1440FFF4 */  bnez      $v0, func_80243094
D_802430C4:
/* 163924 802430C4 24630020 */   addiu    $v1, $v1, 0x20
glabel func_802430C8
/* 163928 802430C8 3C038025 */  lui       $v1, %hi(D_80249BB8)
glabel func_802430CC
/* 16392C 802430CC 24639BB8 */  addiu     $v1, $v1, %lo(D_80249BB8)
glabel func_802430D0
/* 163930 802430D0 8C620000 */  lw        $v0, 0x0($v1)
D_802430D4:
/* 163934 802430D4 14400008 */  bnez      $v0, .L802430F8
dgb_03_pad_30D8:
/* 163938 802430D8 28820040 */   slti     $v0, $a0, 0x40
.L802430DC:
/* 16393C 802430DC 3C028025 */  lui       $v0, %hi(D_80249BA8)
D_802430E0:
/* 163940 802430E0 8C429BA8 */  lw        $v0, %lo(D_80249BA8)($v0)
glabel dead_kzn_17_UnkFunc51
/* 163944 802430E4 14400004 */  bnez      $v0, .L802430F8
D_802430E8:
/* 163948 802430E8 28820040 */   slti     $v0, $a0, 0x40
flo_11_pad_30EC:
/* 16394C 802430EC 24020001 */  addiu     $v0, $zero, 0x1
D_802430F0:
/* 163950 802430F0 AC620000 */  sw        $v0, 0x0($v1)
/* 163954 802430F4 28820040 */  slti      $v0, $a0, 0x40
.L802430F8:
/* 163958 802430F8 1440001E */  bnez      $v0, .L80243174
.L802430FC:
/* 16395C 802430FC 240200FF */   addiu    $v0, $zero, 0xFF
D_80243100:
/* 163960 80243100 3C038025 */  lui       $v1, %hi(D_80249BAC)
glabel func_80243104
/* 163964 80243104 8C639BAC */  lw        $v1, %lo(D_80249BAC)($v1)
glabel func_80243108
/* 163968 80243108 14620010 */  bne       $v1, $v0, D_8024314C
glabel .L8024310C
/* 16396C 8024310C 00000000 */   nop
end_01_Font4Patterns:
/* 163970 80243110 3C038025 */  lui       $v1, %hi(D_80249BB8)
.L80243114:
/* 163974 80243114 24639BB8 */  addiu     $v1, $v1, %lo(D_80249BB8)
D_80243118:
/* 163978 80243118 8C620000 */  lw        $v0, 0x0($v1)
D_8024311C:
/* 16397C 8024311C 1040000F */  beqz      $v0, .L8024315C
D_80243120:
/* 163980 80243120 2442FFFF */   addiu    $v0, $v0, -0x1
glabel func_80243124
/* 163984 80243124 1440001A */  bnez      $v0, D_80243190
.L80243128:
/* 163988 80243128 AC620000 */   sw       $v0, 0x0($v1)
.L8024312C:
/* 16398C 8024312C 3C028025 */  lui       $v0, %hi(D_80249BA0)
D_80243130:
/* 163990 80243130 8C429BA0 */  lw        $v0, %lo(D_80249BA0)($v0)
glabel func_80243134
/* 163994 80243134 3C038025 */  lui       $v1, %hi(D_80249BA4)
glabel func_80243138
/* 163998 80243138 8C639BA4 */  lw        $v1, %lo(D_80249BA4)($v1)
glabel func_8024313C
/* 16399C 8024313C 3C018025 */  lui       $at, %hi(D_80249B94)
/* 1639A0 80243140 AC229B94 */  sw        $v0, %lo(D_80249B94)($at)
.L80243144:
/* 1639A4 80243144 3C018025 */  lui       $at, %hi(D_80249B98)
.L80243148:
/* 1639A8 80243148 AC239B98 */  sw        $v1, %lo(D_80249B98)($at)
D_8024314C:
/* 1639AC 8024314C 3C028025 */  lui       $v0, %hi(D_80249BB8)
.L80243150:
/* 1639B0 80243150 8C429BB8 */  lw        $v0, %lo(D_80249BB8)($v0)
.L80243154:
/* 1639B4 80243154 1440000F */  bnez      $v0, .L80243194
.L80243158:
/* 1639B8 80243158 240200FF */   addiu    $v0, $zero, 0xFF
.L8024315C:
/* 1639BC 8024315C 3C028025 */  lui       $v0, %hi(D_80249BAC)
D_80243160:
/* 1639C0 80243160 8C429BAC */  lw        $v0, %lo(D_80249BAC)($v0)
glabel func_80243164
/* 1639C4 80243164 3C018025 */  lui       $at, %hi(D_80249BA8)
D_80243168:
/* 1639C8 80243168 AC229BA8 */  sw        $v0, %lo(D_80249BA8)($at)
.L8024316C:
/* 1639CC 8024316C 08090C65 */  j         .L80243194
D_80243170_EDBF90:
/* 1639D0 80243170 240200FF */   addiu    $v0, $zero, 0xFF
.L80243174:
/* 1639D4 80243174 3C028025 */  lui       $v0, %hi(D_80249BA8)
end_01_Font3Patterns:
/* 1639D8 80243178 8C429BA8 */  lw        $v0, %lo(D_80249BA8)($v0)
glabel func_8024317C
/* 1639DC 8024317C 14400005 */  bnez      $v0, .L80243194
.L80243180:
/* 1639E0 80243180 240200FF */   addiu    $v0, $zero, 0xFF
.L80243184:
/* 1639E4 80243184 24020001 */  addiu     $v0, $zero, 0x1
glabel func_80243188
/* 1639E8 80243188 3C018025 */  lui       $at, %hi(D_80249BB8)
D_8024318C:
/* 1639EC 8024318C AC229BB8 */  sw        $v0, %lo(D_80249BB8)($at)
D_80243190:
/* 1639F0 80243190 240200FF */  addiu     $v0, $zero, 0xFF
.L80243194:
/* 1639F4 80243194 3C018025 */  lui       $at, %hi(D_80249BAC)
glabel func_80243198
/* 1639F8 80243198 03E00008 */  jr        $ra
glabel .L8024319C
/* 1639FC 8024319C AC229BAC */   sw       $v0, %lo(D_80249BAC)($at)

### DECOMPILED C INSTRUCTIONS:

void filemenu_update_cursor(void) {
    s32 targetPosX = filemenu_cursor_targetX;
    s32 targetPosY = filemenu_cursor_targetY;
    s32 xDelta;
    s32 yDelta;
    s32 i;

    xDelta = (targetPosX - filemenu_cursor_posX) * 0.5;
    yDelta = (targetPosY - filemenu_cursor_posY) * 0.5;

    if ((targetPosX != filemenu_cursor_posX) || (targetPosY != filemenu_cursor_posY)) {
        if ((xDelta == 0) && (yDelta == 0)) {
            filemenu_cursor_posX = targetPosX;
            filemenu_cursor_posY = targetPosY;
        }
    }

    filemenu_cursor_posX += xDelta;
    filemenu_cursor_posY += yDelta;

    if (filemenu_cursorGoalAlpha == 0) {
        filemenu_cursor_alpha -= 128;
        if (filemenu_cursor_alpha < 0) {
            filemenu_cursor_alpha = 0;
        }
    } else {
        filemenu_cursor_alpha += 32;
        if (filemenu_cursor_alpha > 255) {
            filemenu_cursor_alpha = 255;
        }
    }

    for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
        Window* window = &gWindows[i];
        s8 parent = window->parent;

        if ((parent == -1 || parent == WINDOW_ID_FILEMENU_MAIN) && (window->flags & WINDOW_FLAG_INITIAL_ANIMATION)) {
            break;
        }
    }

    if (D_80249BB8 == 0) {
        if (filemenu_cursorGoalAlpha == 0) {
            D_80249BB8 = 1;
        }
    }

    if (i >= ARRAY_COUNT(gWindows)) {
        if (filemenu_cursorGoalAlpha2 == 255) {
            if (D_80249BB8 != 0) {
                D_80249BB8--;
                if (D_80249BB8 == 0) {
                    filemenu_cursor_posX = filemenu_cursor_targetX;
                    filemenu_cursor_posY = filemenu_cursor_targetY;
                }
            }
        }
        if (D_80249BB8 == 0) {
            filemenu_cursorGoalAlpha = filemenu_cursorGoalAlpha2;
        }
    } else if (filemenu_cursorGoalAlpha == 0) {
        D_80249BB8 = 1;
    }

    filemenu_cursorGoalAlpha2 = 255;
}