### RAW ASSEMBLY INSTRUCTIONS:

glabel huff_puff_breath_appendGfx
/* 3D7D74 E00DC304 27BDFF38 */  addiu     $sp, $sp, -0xC8
/* 3D7D78 E00DC308 0080302D */  daddu     $a2, $a0, $zero
/* 3D7D7C E00DC30C 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3D7D80 E00DC310 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3D7D84 E00DC314 27A40018 */  addiu     $a0, $sp, 0x18
/* 3D7D88 E00DC318 AFB400B0 */  sw        $s4, 0xB0($sp)
/* 3D7D8C E00DC31C 3C14800A */  lui       $s4, %hi(gMainGfxPos)
/* 3D7D90 E00DC320 2694A66C */  addiu     $s4, $s4, %lo(gMainGfxPos)
/* 3D7D94 E00DC324 AFBF00C4 */  sw        $ra, 0xC4($sp)
/* 3D7D98 E00DC328 AFBE00C0 */  sw        $fp, 0xC0($sp)
/* 3D7D9C E00DC32C AFB700BC */  sw        $s7, 0xBC($sp)
/* 3D7DA0 E00DC330 AFB600B8 */  sw        $s6, 0xB8($sp)
/* 3D7DA4 E00DC334 AFB500B4 */  sw        $s5, 0xB4($sp)
/* 3D7DA8 E00DC338 AFB300AC */  sw        $s3, 0xAC($sp)
/* 3D7DAC E00DC33C AFB200A8 */  sw        $s2, 0xA8($sp)
/* 3D7DB0 E00DC340 AFB100A4 */  sw        $s1, 0xA4($sp)
/* 3D7DB4 E00DC344 AFB000A0 */  sw        $s0, 0xA0($sp)
/* 3D7DB8 E00DC348 8E850000 */  lw        $a1, 0x0($s4)
/* 3D7DBC E00DC34C 8CD2000C */  lw        $s2, 0xC($a2)
/* 3D7DC0 E00DC350 3C014080 */  lui       $at, (0x40800000 >> 16)
/* 3D7DC4 E00DC354 44810000 */  mtc1      $at, $f0
/* 3D7DC8 E00DC358 00A0182D */  daddu     $v1, $a1, $zero
/* 3D7DCC E00DC35C 24A50008 */  addiu     $a1, $a1, 0x8
/* 3D7DD0 E00DC360 AE850000 */  sw        $a1, 0x0($s4)
/* 3D7DD4 E00DC364 8E570024 */  lw        $s7, 0x24($s2)
/* 3D7DD8 E00DC368 8E4A0000 */  lw        $t2, 0x0($s2)
/* 3D7DDC E00DC36C 3C1E0001 */  lui       $fp, (0x11630 >> 16)
/* 3D7DE0 E00DC370 AFAA0098 */  sw        $t2, 0x98($sp)
/* 3D7DE4 E00DC374 C6420038 */  lwc1      $f2, 0x38($s2)
/* 3D7DE8 E00DC378 C6440040 */  lwc1      $f4, 0x40($s2)
/* 3D7DEC E00DC37C 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3D7DF0 E00DC380 AC620000 */  sw        $v0, 0x0($v1)
/* 3D7DF4 E00DC384 AC600004 */  sw        $zero, 0x4($v1)
/* 3D7DF8 E00DC388 ACA70000 */  sw        $a3, 0x0($a1)
/* 3D7DFC E00DC38C 8CC30010 */  lw        $v1, 0x10($a2)
/* 3D7E00 E00DC390 46001082 */  mul.s     $f2, $f2, $f0
/* 3D7E04 E00DC394 00000000 */  nop
/* 3D7E08 E00DC398 24A20008 */  addiu     $v0, $a1, 0x8
/* 3D7E0C E00DC39C AE820000 */  sw        $v0, 0x0($s4)
/* 3D7E10 E00DC3A0 8C62001C */  lw        $v0, 0x1C($v1)
/* 3D7E14 E00DC3A4 3C038000 */  lui       $v1, (0x80000000 >> 16)
/* 3D7E18 E00DC3A8 46002102 */  mul.s     $f4, $f4, $f0
/* 3D7E1C E00DC3AC 00000000 */  nop
/* 3D7E20 E00DC3B0 00431021 */  addu      $v0, $v0, $v1
/* 3D7E24 E00DC3B4 3C03800B */  lui       $v1, %hi(gCameras)
/* 3D7E28 E00DC3B8 24631D80 */  addiu     $v1, $v1, %lo(gCameras)
/* 3D7E2C E00DC3BC ACA20004 */  sw        $v0, 0x4($a1)
/* 3D7E30 E00DC3C0 8E450004 */  lw        $a1, 0x4($s2)
/* 3D7E34 E00DC3C4 8E460008 */  lw        $a2, 0x8($s2)
/* 3D7E38 E00DC3C8 3C028007 */  lui       $v0, %hi(gCurrentCameraID)
/* 3D7E3C E00DC3CC 8C427410 */  lw        $v0, %lo(gCurrentCameraID)($v0)
/* 3D7E40 E00DC3D0 8E47000C */  lw        $a3, 0xC($s2)
/* 3D7E44 E00DC3D4 00028880 */  sll       $s1, $v0, 2
/* 3D7E48 E00DC3D8 02228821 */  addu      $s1, $s1, $v0
/* 3D7E4C E00DC3DC 00118880 */  sll       $s1, $s1, 2
/* 3D7E50 E00DC3E0 02228823 */  subu      $s1, $s1, $v0
/* 3D7E54 E00DC3E4 001110C0 */  sll       $v0, $s1, 3
/* 3D7E58 E00DC3E8 02228821 */  addu      $s1, $s1, $v0
/* 3D7E5C E00DC3EC 001188C0 */  sll       $s1, $s1, 3
/* 3D7E60 E00DC3F0 4600118D */  trunc.w.s $f6, $f2
/* 3D7E64 E00DC3F4 44133000 */  mfc1      $s3, $f6
/* 3D7E68 E00DC3F8 4600218D */  trunc.w.s $f6, $f4
/* 3D7E6C E00DC3FC 44163000 */  mfc1      $s6, $f6
/* 3D7E70 E00DC400 0C080108 */  jal       shim_guTranslateF
/* 3D7E74 E00DC404 02238821 */   addu     $s1, $s1, $v1
/* 3D7E78 E00DC408 37DE1630 */  ori       $fp, $fp, (0x11630 & 0xFFFF)
/* 3D7E7C E00DC40C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3D7E80 E00DC410 44810000 */  mtc1      $at, $f0
/* 3D7E84 E00DC414 27B00058 */  addiu     $s0, $sp, 0x58
/* 3D7E88 E00DC418 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3D7E8C E00DC41C 44800000 */  mtc1      $zero, $f0
/* 3D7E90 E00DC420 0200202D */  daddu     $a0, $s0, $zero
/* 3D7E94 E00DC424 44060000 */  mfc1      $a2, $f0
/* 3D7E98 E00DC428 8E450048 */  lw        $a1, 0x48($s2)
/* 3D7E9C E00DC42C 0C080104 */  jal       shim_guRotateF
/* 3D7EA0 E00DC430 00C0382D */   daddu    $a3, $a2, $zero
/* 3D7EA4 E00DC434 0200202D */  daddu     $a0, $s0, $zero
/* 3D7EA8 E00DC438 27A50018 */  addiu     $a1, $sp, 0x18
/* 3D7EAC E00DC43C 0C080114 */  jal       shim_guMtxCatF
/* 3D7EB0 E00DC440 00A0302D */   daddu    $a2, $a1, $zero
/* 3D7EB4 E00DC444 8E45004C */  lw        $a1, 0x4C($s2)
/* 3D7EB8 E00DC448 0200202D */  daddu     $a0, $s0, $zero
/* 3D7EBC E00DC44C 00A0302D */  daddu     $a2, $a1, $zero
/* 3D7EC0 E00DC450 0C080110 */  jal       shim_guScaleF
/* 3D7EC4 E00DC454 00A0382D */   daddu    $a3, $a1, $zero
/* 3D7EC8 E00DC458 0200202D */  daddu     $a0, $s0, $zero
/* 3D7ECC E00DC45C 27A50018 */  addiu     $a1, $sp, 0x18
/* 3D7ED0 E00DC460 0C080114 */  jal       shim_guMtxCatF
/* 3D7ED4 E00DC464 00A0302D */   daddu    $a2, $a1, $zero
/* 3D7ED8 E00DC468 27A40018 */  addiu     $a0, $sp, 0x18
/* 3D7EDC E00DC46C 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 3D7EE0 E00DC470 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 3D7EE4 E00DC474 3C15800A */  lui       $s5, %hi(gDisplayContext)
/* 3D7EE8 E00DC478 26B5A674 */  addiu     $s5, $s5, %lo(gDisplayContext)
/* 3D7EEC E00DC47C 96050000 */  lhu       $a1, 0x0($s0)
/* 3D7EF0 E00DC480 8EA20000 */  lw        $v0, 0x0($s5)
/* 3D7EF4 E00DC484 00052980 */  sll       $a1, $a1, 6
/* 3D7EF8 E00DC488 00BE2821 */  addu      $a1, $a1, $fp
/* 3D7EFC E00DC48C 0C080118 */  jal       shim_guMtxF2L
/* 3D7F00 E00DC490 00452821 */   addu     $a1, $v0, $a1
/* 3D7F04 E00DC494 3C03DA38 */  lui       $v1, (0xDA380002 >> 16)
/* 3D7F08 E00DC498 34630002 */  ori       $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3D7F0C E00DC49C 3C06DA38 */  lui       $a2, (0xDA380001 >> 16)
/* 3D7F10 E00DC4A0 34C60001 */  ori       $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3D7F14 E00DC4A4 3C09D838 */  lui       $t1, (0xD8380002 >> 16)
/* 3D7F18 E00DC4A8 35290002 */  ori       $t1, $t1, (0xD8380002 & 0xFFFF)
/* 3D7F1C E00DC4AC 32F700FF */  andi      $s7, $s7, 0xFF
/* 3D7F20 E00DC4B0 3C08DE00 */  lui       $t0, (0xDE000000 >> 16)
/* 3D7F24 E00DC4B4 8E850000 */  lw        $a1, 0x0($s4)
/* 3D7F28 E00DC4B8 96020000 */  lhu       $v0, 0x0($s0)
/* 3D7F2C E00DC4BC 00A0202D */  daddu     $a0, $a1, $zero
/* 3D7F30 E00DC4C0 24A50008 */  addiu     $a1, $a1, 0x8
/* 3D7F34 E00DC4C4 AE850000 */  sw        $a1, 0x0($s4)
/* 3D7F38 E00DC4C8 AC830000 */  sw        $v1, 0x0($a0)
/* 3D7F3C E00DC4CC 24430001 */  addiu     $v1, $v0, 0x1
/* 3D7F40 E00DC4D0 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3D7F44 E00DC4D4 00021180 */  sll       $v0, $v0, 6
/* 3D7F48 E00DC4D8 A6030000 */  sh        $v1, 0x0($s0)
/* 3D7F4C E00DC4DC 8EA30000 */  lw        $v1, 0x0($s5)
/* 3D7F50 E00DC4E0 005E1021 */  addu      $v0, $v0, $fp
/* 3D7F54 E00DC4E4 00621821 */  addu      $v1, $v1, $v0
/* 3D7F58 E00DC4E8 24A20008 */  addiu     $v0, $a1, 0x8
/* 3D7F5C E00DC4EC AC830004 */  sw        $v1, 0x4($a0)
/* 3D7F60 E00DC4F0 AE820000 */  sw        $v0, 0x0($s4)
/* 3D7F64 E00DC4F4 24A20010 */  addiu     $v0, $a1, 0x10
/* 3D7F68 E00DC4F8 ACA60000 */  sw        $a2, 0x0($a1)
/* 3D7F6C E00DC4FC AE820000 */  sw        $v0, 0x0($s4)
/* 3D7F70 E00DC500 8E230204 */  lw        $v1, 0x204($s1)
/* 3D7F74 E00DC504 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3D7F78 E00DC508 ACA20008 */  sw        $v0, 0x8($a1)
/* 3D7F7C E00DC50C ACA30004 */  sw        $v1, 0x4($a1)
/* 3D7F80 E00DC510 9242001B */  lbu       $v0, 0x1B($s2)
/* 3D7F84 E00DC514 9244001F */  lbu       $a0, 0x1F($s2)
/* 3D7F88 E00DC518 92460023 */  lbu       $a2, 0x23($s2)
/* 3D7F8C E00DC51C 24A30018 */  addiu     $v1, $a1, 0x18
/* 3D7F90 E00DC520 AE830000 */  sw        $v1, 0x0($s4)
/* 3D7F94 E00DC524 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 3D7F98 E00DC528 ACA30010 */  sw        $v1, 0x10($a1)
/* 3D7F9C E00DC52C 00021600 */  sll       $v0, $v0, 24
/* 3D7FA0 E00DC530 00042400 */  sll       $a0, $a0, 16
/* 3D7FA4 E00DC534 00441025 */  or        $v0, $v0, $a0
/* 3D7FA8 E00DC538 00063200 */  sll       $a2, $a2, 8
/* 3D7FAC E00DC53C 00461025 */  or        $v0, $v0, $a2
/* 3D7FB0 E00DC540 00571025 */  or        $v0, $v0, $s7
/* 3D7FB4 E00DC544 ACA2000C */  sw        $v0, 0xC($a1)
/* 3D7FB8 E00DC548 9243002B */  lbu       $v1, 0x2B($s2)
/* 3D7FBC E00DC54C 9244002F */  lbu       $a0, 0x2F($s2)
/* 3D7FC0 E00DC550 92460033 */  lbu       $a2, 0x33($s2)
/* 3D7FC4 E00DC554 92470037 */  lbu       $a3, 0x37($s2)
/* 3D7FC8 E00DC558 24A20020 */  addiu     $v0, $a1, 0x20
/* 3D7FCC E00DC55C AE820000 */  sw        $v0, 0x0($s4)
/* 3D7FD0 E00DC560 24A20028 */  addiu     $v0, $a1, 0x28
/* 3D7FD4 E00DC564 ACA80018 */  sw        $t0, 0x18($a1)
/* 3D7FD8 E00DC568 AE820000 */  sw        $v0, 0x0($s4)
/* 3D7FDC E00DC56C 32C20FFF */  andi      $v0, $s6, 0xFFF
/* 3D7FE0 E00DC570 26D6003C */  addiu     $s6, $s6, 0x3C
/* 3D7FE4 E00DC574 32D60FFF */  andi      $s6, $s6, 0xFFF
/* 3D7FE8 E00DC578 00031E00 */  sll       $v1, $v1, 24
/* 3D7FEC E00DC57C 00042400 */  sll       $a0, $a0, 16
/* 3D7FF0 E00DC580 00641825 */  or        $v1, $v1, $a0
/* 3D7FF4 E00DC584 00063200 */  sll       $a2, $a2, 8
/* 3D7FF8 E00DC588 00661825 */  or        $v1, $v1, $a2
/* 3D7FFC E00DC58C 00671825 */  or        $v1, $v1, $a3
/* 3D8000 E00DC590 32640FFF */  andi      $a0, $s3, 0xFFF
/* 3D8004 E00DC594 00042300 */  sll       $a0, $a0, 12
/* 3D8008 E00DC598 ACA30014 */  sw        $v1, 0x14($a1)
/* 3D800C E00DC59C 3C03F200 */  lui       $v1, (0xF2000000 >> 16)
/* 3D8010 E00DC5A0 00431025 */  or        $v0, $v0, $v1
/* 3D8014 E00DC5A4 00822025 */  or        $a0, $a0, $v0
/* 3D8018 E00DC5A8 2673007C */  addiu     $s3, $s3, 0x7C
/* 3D801C E00DC5AC 32730FFF */  andi      $s3, $s3, 0xFFF
/* 3D8020 E00DC5B0 8FAA0098 */  lw        $t2, 0x98($sp)
/* 3D8024 E00DC5B4 00139B00 */  sll       $s3, $s3, 12
/* 3D8028 E00DC5B8 000A9080 */  sll       $s2, $t2, 2
/* 3D802C E00DC5BC 3C03E00E */  lui       $v1, (0xE00E0000 >> 16)
/* 3D8030 E00DC5C0 00721821 */  addu      $v1, $v1, $s2
/* 3D8034 E00DC5C4 8C63C648 */  lw        $v1, -0x39B8($v1)
/* 3D8038 E00DC5C8 02769825 */  or        $s3, $s3, $s6
/* 3D803C E00DC5CC ACA40020 */  sw        $a0, 0x20($a1)
/* 3D8040 E00DC5D0 ACB30024 */  sw        $s3, 0x24($a1)
/* 3D8044 E00DC5D4 ACA80028 */  sw        $t0, 0x28($a1)
/* 3D8048 E00DC5D8 ACA3001C */  sw        $v1, 0x1C($a1)
/* 3D804C E00DC5DC 3C03E00E */  lui       $v1, (0xE00E0000 >> 16)
/* 3D8050 E00DC5E0 00721821 */  addu      $v1, $v1, $s2
/* 3D8054 E00DC5E4 8C63C640 */  lw        $v1, -0x39C0($v1)
/* 3D8058 E00DC5E8 24A20030 */  addiu     $v0, $a1, 0x30
/* 3D805C E00DC5EC AE820000 */  sw        $v0, 0x0($s4)
/* 3D8060 E00DC5F0 24A20038 */  addiu     $v0, $a1, 0x38
/* 3D8064 E00DC5F4 ACA3002C */  sw        $v1, 0x2C($a1)
/* 3D8068 E00DC5F8 AE820000 */  sw        $v0, 0x0($s4)
/* 3D806C E00DC5FC 24020040 */  addiu     $v0, $zero, 0x40
/* 3D8070 E00DC600 ACA90030 */  sw        $t1, 0x30($a1)
/* 3D8074 E00DC604 ACA20034 */  sw        $v0, 0x34($a1)
/* 3D8078 E00DC608 8FBF00C4 */  lw        $ra, 0xC4($sp)
/* 3D807C E00DC60C 8FBE00C0 */  lw        $fp, 0xC0($sp)
/* 3D8080 E00DC610 8FB700BC */  lw        $s7, 0xBC($sp)
/* 3D8084 E00DC614 8FB600B8 */  lw        $s6, 0xB8($sp)
/* 3D8088 E00DC618 8FB500B4 */  lw        $s5, 0xB4($sp)
/* 3D808C E00DC61C 8FB400B0 */  lw        $s4, 0xB0($sp)
/* 3D8090 E00DC620 8FB300AC */  lw        $s3, 0xAC($sp)
/* 3D8094 E00DC624 8FB200A8 */  lw        $s2, 0xA8($sp)
/* 3D8098 E00DC628 8FB100A4 */  lw        $s1, 0xA4($sp)
/* 3D809C E00DC62C 8FB000A0 */  lw        $s0, 0xA0($sp)
/* 3D80A0 E00DC630 03E00008 */  jr        $ra
/* 3D80A4 E00DC634 27BD00C8 */   addiu    $sp, $sp, 0xC8
/* 3D80A8 E00DC638 00000000 */  nop
/* 3D80AC E00DC63C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void huff_puff_breath_appendGfx(void* effect) {
    HuffPuffBreathFXData* data = ((EffectInstance*)effect)->data.huffPuffBreath;
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 primA = data->primA;
    s32 unk_00 = data->type;
    s32 uls = data->texOffsetX * 4.0f;
    s32 ult = data->texOffsetY * 4.0f;
    Matrix4f sp18;
    Matrix4f sp58;

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

    shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(sp58, data->angle, 0.0f, 0.0f, 1.0f);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guScaleF(sp58, data->scale, data->scale, data->scale);
    shim_guMtxCatF(sp58, sp18, sp18);
    shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, primA);
    gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA);
    gSPDisplayList(gMainGfxPos++, D_E00DC648[unk_00]);
    gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 31 * 4, ult + 15 * 4);
    gSPDisplayList(gMainGfxPos++, D_E00DC640[unk_00]);
    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802591EC
/* 187ACC 802591EC 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 187AD0 802591F0 00A0482D */  daddu     $t1, $a1, $zero
/* 187AD4 802591F4 00C0502D */  daddu     $t2, $a2, $zero
/* 187AD8 802591F8 AFBF0018 */  sw        $ra, 0x18($sp)
/* 187ADC 802591FC 8D250000 */  lw        $a1, 0x0($t1)
/* 187AE0 80259200 8FA80030 */  lw        $t0, 0x30($sp)
/* 187AE4 80259204 30A20002 */  andi      $v0, $a1, 0x2
/* 187AE8 80259208 10400033 */  beqz      $v0, .L802592D8
/* 187AEC 8025920C 00E0582D */   daddu    $t3, $a3, $zero
/* 187AF0 80259210 240600FF */  addiu     $a2, $zero, 0xFF
/* 187AF4 80259214 85230098 */  lh        $v1, 0x98($t1)
/* 187AF8 80259218 0066102A */  slt       $v0, $v1, $a2
/* 187AFC 8025921C 10400003 */  beqz      $v0, .L8025922C
/* 187B00 80259220 0000402D */   daddu    $t0, $zero, $zero
/* 187B04 80259224 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 187B08 80259228 0060302D */  daddu     $a2, $v1, $zero
.L8025922C:
/* 187B0C 8025922C 30A20100 */  andi      $v0, $a1, 0x100
/* 187B10 80259230 1040000C */  beqz      $v0, .L80259264
/* 187B14 80259234 3C038080 */   lui      $v1, (0x80808081 >> 16)
/* 187B18 80259238 34638081 */  ori       $v1, $v1, (0x80808081 & 0xFFFF)
/* 187B1C 8025923C 00061100 */  sll       $v0, $a2, 4
/* 187B20 80259240 00461023 */  subu      $v0, $v0, $a2
/* 187B24 80259244 000210C0 */  sll       $v0, $v0, 3
/* 187B28 80259248 00430018 */  mult      $v0, $v1
/* 187B2C 8025924C 3C088000 */  lui       $t0, (0x80000000 >> 16)
/* 187B30 80259250 00006010 */  mfhi      $t4
/* 187B34 80259254 01821821 */  addu      $v1, $t4, $v0
/* 187B38 80259258 000319C3 */  sra       $v1, $v1, 7
/* 187B3C 8025925C 000217C3 */  sra       $v0, $v0, 31
/* 187B40 80259260 00623023 */  subu      $a2, $v1, $v0
.L80259264:
/* 187B44 80259264 1480000D */  bnez      $a0, .L8025929C
/* 187B48 80259268 240200FF */   addiu    $v0, $zero, 0xFF
/* 187B4C 8025926C 14C20005 */  bne       $a2, $v0, .L80259284
/* 187B50 80259270 AFAB0010 */   sw       $t3, 0x10($sp)
/* 187B54 80259274 0000202D */  daddu     $a0, $zero, $zero
/* 187B58 80259278 0140282D */  daddu     $a1, $t2, $zero
/* 187B5C 8025927C 080964A3 */  j         .L8025928C
/* 187B60 80259280 0080302D */   daddu    $a2, $a0, $zero
.L80259284:
/* 187B64 80259284 0100202D */  daddu     $a0, $t0, $zero
/* 187B68 80259288 0140282D */  daddu     $a1, $t2, $zero
.L8025928C:
/* 187B6C 8025928C 0C0B7710 */  jal       spr_draw_player_sprite
/* 187B70 80259290 0000382D */   daddu    $a3, $zero, $zero
/* 187B74 80259294 08096522 */  j         .L80259488
/* 187B78 80259298 0000102D */   daddu    $v0, $zero, $zero
.L8025929C:
/* 187B7C 8025929C 14C20006 */  bne       $a2, $v0, .L802592B8
/* 187B80 802592A0 0140282D */   daddu    $a1, $t2, $zero
/* 187B84 802592A4 0000302D */  daddu     $a2, $zero, $zero
/* 187B88 802592A8 AFAB0010 */  sw        $t3, 0x10($sp)
/* 187B8C 802592AC 8D240084 */  lw        $a0, 0x84($t1)
/* 187B90 802592B0 080964B2 */  j         .L802592C8
/* 187B94 802592B4 00C0382D */   daddu    $a3, $a2, $zero
.L802592B8:
/* 187B98 802592B8 8D240084 */  lw        $a0, 0x84($t1)
/* 187B9C 802592BC 0000382D */  daddu     $a3, $zero, $zero
/* 187BA0 802592C0 AFAB0010 */  sw        $t3, 0x10($sp)
/* 187BA4 802592C4 00882025 */  or        $a0, $a0, $t0
.L802592C8:
/* 187BA8 802592C8 0C0B78F6 */  jal       spr_draw_npc_sprite
/* 187BAC 802592CC 00000000 */   nop
/* 187BB0 802592D0 08096522 */  j         .L80259488
/* 187BB4 802592D4 0000102D */   daddu    $v0, $zero, $zero
.L802592D8:
/* 187BB8 802592D8 8D2200C0 */  lw        $v0, 0xC0($t1)
/* 187BBC 802592DC 804306C0 */  lb        $v1, 0x6C0($v0)
/* 187BC0 802592E0 2C620011 */  sltiu     $v0, $v1, 0x11
/* 187BC4 802592E4 10400067 */  beqz      $v0, .L80259484
/* 187BC8 802592E8 00031080 */   sll      $v0, $v1, 2
/* 187BCC 802592EC 3C01802A */  lui       $at, %hi(jtbl_8029D3A0)
/* 187BD0 802592F0 00220821 */  addu      $at, $at, $v0
/* 187BD4 802592F4 8C22D3A0 */  lw        $v0, %lo(jtbl_8029D3A0)($at)
/* 187BD8 802592F8 00400008 */  jr        $v0
/* 187BDC 802592FC 00000000 */   nop
glabel .L80259300
/* 187BE0 80259300 AFA80010 */  sw        $t0, 0x10($sp)
/* 187BE4 80259304 0120282D */  daddu     $a1, $t1, $zero
/* 187BE8 80259308 0140302D */  daddu     $a2, $t2, $zero
/* 187BEC 8025930C 0C096692 */  jal       func_80259A48
/* 187BF0 80259310 0160382D */   daddu    $a3, $t3, $zero
/* 187BF4 80259314 08096522 */  j         .L80259488
/* 187BF8 80259318 0000102D */   daddu    $v0, $zero, $zero
glabel .L8025931C
/* 187BFC 8025931C AFA80010 */  sw        $t0, 0x10($sp)
/* 187C00 80259320 0120282D */  daddu     $a1, $t1, $zero
/* 187C04 80259324 0140302D */  daddu     $a2, $t2, $zero
/* 187C08 80259328 0C0966AB */  jal       func_80259AAC
/* 187C0C 8025932C 0160382D */   daddu    $a3, $t3, $zero
/* 187C10 80259330 08096522 */  j         .L80259488
/* 187C14 80259334 0000102D */   daddu    $v0, $zero, $zero
glabel .L80259338
/* 187C18 80259338 AFA80010 */  sw        $t0, 0x10($sp)
/* 187C1C 8025933C 0120282D */  daddu     $a1, $t1, $zero
/* 187C20 80259340 0140302D */  daddu     $a2, $t2, $zero
/* 187C24 80259344 0C096767 */  jal       func_80259D9C
/* 187C28 80259348 0160382D */   daddu    $a3, $t3, $zero
/* 187C2C 8025934C 08096522 */  j         .L80259488
/* 187C30 80259350 0000102D */   daddu    $v0, $zero, $zero
glabel .L80259354
/* 187C34 80259354 AFA80010 */  sw        $t0, 0x10($sp)
/* 187C38 80259358 0120282D */  daddu     $a1, $t1, $zero
/* 187C3C 8025935C 0140302D */  daddu     $a2, $t2, $zero
/* 187C40 80259360 0C0968B1 */  jal       func_8025A2C4
/* 187C44 80259364 0160382D */   daddu    $a3, $t3, $zero
/* 187C48 80259368 08096522 */  j         .L80259488
/* 187C4C 8025936C 0000102D */   daddu    $v0, $zero, $zero
glabel .L80259370
/* 187C50 80259370 AFA80010 */  sw        $t0, 0x10($sp)
/* 187C54 80259374 0120282D */  daddu     $a1, $t1, $zero
/* 187C58 80259378 0140302D */  daddu     $a2, $t2, $zero
/* 187C5C 8025937C 0C096943 */  jal       func_8025A50C
/* 187C60 80259380 0160382D */   daddu    $a3, $t3, $zero
/* 187C64 80259384 08096522 */  j         .L80259488
/* 187C68 80259388 0000102D */   daddu    $v0, $zero, $zero
glabel .L8025938C
/* 187C6C 8025938C AFA80010 */  sw        $t0, 0x10($sp)
/* 187C70 80259390 0120282D */  daddu     $a1, $t1, $zero
/* 187C74 80259394 0140302D */  daddu     $a2, $t2, $zero
/* 187C78 80259398 0C0969D3 */  jal       func_8025A74C
/* 187C7C 8025939C 0160382D */   daddu    $a3, $t3, $zero
/* 187C80 802593A0 08096522 */  j         .L80259488
/* 187C84 802593A4 0000102D */   daddu    $v0, $zero, $zero
glabel .L802593A8
/* 187C88 802593A8 AFA80010 */  sw        $t0, 0x10($sp)
/* 187C8C 802593AC 0120282D */  daddu     $a1, $t1, $zero
/* 187C90 802593B0 0140302D */  daddu     $a2, $t2, $zero
/* 187C94 802593B4 0C096AA0 */  jal       func_8025AA80
/* 187C98 802593B8 0160382D */   daddu    $a3, $t3, $zero
/* 187C9C 802593BC 08096522 */  j         .L80259488
/* 187CA0 802593C0 0000102D */   daddu    $v0, $zero, $zero
glabel .L802593C4
/* 187CA4 802593C4 AFA80010 */  sw        $t0, 0x10($sp)
/* 187CA8 802593C8 0120282D */  daddu     $a1, $t1, $zero
/* 187CAC 802593CC 0140302D */  daddu     $a2, $t2, $zero
/* 187CB0 802593D0 0C096B64 */  jal       func_8025AD90
/* 187CB4 802593D4 0160382D */   daddu    $a3, $t3, $zero
/* 187CB8 802593D8 08096522 */  j         .L80259488
/* 187CBC 802593DC 0000102D */   daddu    $v0, $zero, $zero
glabel .L802593E0
/* 187CC0 802593E0 AFA80010 */  sw        $t0, 0x10($sp)
/* 187CC4 802593E4 0120282D */  daddu     $a1, $t1, $zero
/* 187CC8 802593E8 0140302D */  daddu     $a2, $t2, $zero
/* 187CCC 802593EC 0C096C6A */  jal       func_8025B1A8
/* 187CD0 802593F0 0160382D */   daddu    $a3, $t3, $zero
/* 187CD4 802593F4 08096522 */  j         .L80259488
/* 187CD8 802593F8 0000102D */   daddu    $v0, $zero, $zero
glabel .L802593FC
/* 187CDC 802593FC 0120282D */  daddu     $a1, $t1, $zero
/* 187CE0 80259400 0140302D */  daddu     $a2, $t2, $zero
/* 187CE4 80259404 0160382D */  daddu     $a3, $t3, $zero
/* 187CE8 80259408 AFA80010 */  sw        $t0, 0x10($sp)
/* 187CEC 8025940C 0C096D70 */  jal       func_8025B5C0
/* 187CF0 80259410 AFA00014 */   sw       $zero, 0x14($sp)
/* 187CF4 80259414 08096522 */  j         .L80259488
/* 187CF8 80259418 0000102D */   daddu    $v0, $zero, $zero
glabel .L8025941C
/* 187CFC 8025941C 0120282D */  daddu     $a1, $t1, $zero
/* 187D00 80259420 0140302D */  daddu     $a2, $t2, $zero
/* 187D04 80259424 0160382D */  daddu     $a3, $t3, $zero
/* 187D08 80259428 24020001 */  addiu     $v0, $zero, 0x1
/* 187D0C 8025942C AFA80010 */  sw        $t0, 0x10($sp)
/* 187D10 80259430 0C096D70 */  jal       func_8025B5C0
/* 187D14 80259434 AFA20014 */   sw       $v0, 0x14($sp)
/* 187D18 80259438 08096522 */  j         .L80259488
/* 187D1C 8025943C 0000102D */   daddu    $v0, $zero, $zero
glabel .L80259440
/* 187D20 80259440 0120282D */  daddu     $a1, $t1, $zero
/* 187D24 80259444 0140302D */  daddu     $a2, $t2, $zero
/* 187D28 80259448 08096517 */  j         .L8025945C
/* 187D2C 8025944C 0000382D */   daddu    $a3, $zero, $zero
glabel .L80259450
/* 187D30 80259450 0120282D */  daddu     $a1, $t1, $zero
/* 187D34 80259454 0140302D */  daddu     $a2, $t2, $zero
/* 187D38 80259458 24070001 */  addiu     $a3, $zero, 0x1
.L8025945C:
/* 187D3C 8025945C AFAB0010 */  sw        $t3, 0x10($sp)
/* 187D40 80259460 0C096EA8 */  jal       func_8025BAA0
/* 187D44 80259464 AFA80014 */   sw       $t0, 0x14($sp)
/* 187D48 80259468 08096522 */  j         .L80259488
/* 187D4C 8025946C 0000102D */   daddu    $v0, $zero, $zero
glabel .L80259470
/* 187D50 80259470 AFA80010 */  sw        $t0, 0x10($sp)
/* 187D54 80259474 0120282D */  daddu     $a1, $t1, $zero
/* 187D58 80259478 0140302D */  daddu     $a2, $t2, $zero
/* 187D5C 8025947C 0C097048 */  jal       func_8025C120
/* 187D60 80259480 0160382D */   daddu    $a3, $t3, $zero
glabel .L80259484
/* 187D64 80259484 0000102D */  daddu     $v0, $zero, $zero
.L80259488:
/* 187D68 80259488 8FBF0018 */  lw        $ra, 0x18($sp)
/* 187D6C 8025948C 03E00008 */  jr        $ra
/* 187D70 80259490 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

s32 render_with_adjusted_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
    s32 opacity;
    s32 sprDrawOpts;

    if (part->flags & ACTOR_PART_FLAG_2) {
        opacity = 255;
        sprDrawOpts = 0;
        if (part->opacity < 255) {
            sprDrawOpts = DRAW_SPRITE_OVERRIDE_ALPHA;
            opacity = part->opacity;
        }
        if (part->flags & ACTOR_PART_FLAG_100) {
            sprDrawOpts = DRAW_SPRITE_OVERRIDE_ALPHA;
            opacity = opacity * 120 / 255;
        }
        if (isNpcSprite == SPRITE_MODE_PLAYER) {
            if (opacity == 255) {
                spr_draw_player_sprite(PLAYER_SPRITE_MAIN, yaw, 0, NULL, mtx);
            } else {
                spr_draw_player_sprite(PLAYER_SPRITE_MAIN | sprDrawOpts, yaw, opacity, NULL, mtx);
            }
        } else {
            if (opacity == 255) {
                spr_draw_npc_sprite(part->spriteInstanceID, yaw, 0, NULL, mtx);
            } else {
                spr_draw_npc_sprite(part->spriteInstanceID | sprDrawOpts, yaw, opacity, NULL, mtx);
            }
        }
        return 0;
    }

    switch (part->decorationTable->paletteAdjustment) {
        case PAL_ADJUST_NONE:
            render_without_adjusted_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_SLEEP:
            render_with_sleep_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_STATIC:
            render_with_static_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_FEAR:
            render_with_fear_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_POISON:
            render_with_poison_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_PARALYZE:
            render_with_paralyze_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_BERSERK:
            render_with_berserk_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_WATT_IDLE:
            render_with_watt_idle_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_WATT_ATTACK:
            render_with_watt_attack_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        case PAL_ADJUST_PLAYER_DEBUFF:
            render_with_player_debuff_palettes(isNpcSprite, part, yaw, mtx, skipAnimation, FALSE);
            break;
        case PAL_ADJUST_PLAYER_POISON:
            render_with_player_debuff_palettes(isNpcSprite, part, yaw, mtx, skipAnimation, TRUE);
            break;
        case PAL_ADJUST_BLEND_PALETTES_UNIFORM_INTERVALS:
            render_with_pal_blending(isNpcSprite, part, yaw, FALSE, mtx, skipAnimation);
            break;
        case PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS:
            render_with_pal_blending(isNpcSprite, part, yaw, TRUE, mtx, skipAnimation);
            break;
        case PAL_ADJUST_BLEND_PALSETS:
            render_with_palset_blending(isNpcSprite, part, yaw, mtx, skipAnimation);
            break;
        default:
            break;
    }
    return 0;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel entity_block_handle_collision
/* 105424 802E3BA4 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 105428 802E3BA8 AFB1001C */  sw        $s1, 0x1C($sp)
/* 10542C 802E3BAC 0080882D */  daddu     $s1, $a0, $zero
/* 105430 802E3BB0 AFBF0024 */  sw        $ra, 0x24($sp)
/* 105434 802E3BB4 AFB20020 */  sw        $s2, 0x20($sp)
/* 105438 802E3BB8 AFB00018 */  sw        $s0, 0x18($sp)
/* 10543C 802E3BBC 9222000B */  lbu       $v0, 0xB($s1)
/* 105440 802E3BC0 3C128011 */  lui       $s2, %hi(gPlayerStatus)
/* 105444 802E3BC4 2652EFC8 */  addiu     $s2, $s2, %lo(gPlayerStatus)
/* 105448 802E3BC8 14400005 */  bnez      $v0, .L802E3BE0
/* 10544C 802E3BCC 00000000 */   nop
/* 105450 802E3BD0 92220006 */  lbu       $v0, 0x6($s1)
/* 105454 802E3BD4 30420001 */  andi      $v0, $v0, 0x1
/* 105458 802E3BD8 14400083 */  bnez      $v0, .L802E3DE8
/* 10545C 802E3BDC 0000102D */   daddu    $v0, $zero, $zero
.L802E3BE0:
/* 105460 802E3BE0 92230006 */  lbu       $v1, 0x6($s1)
/* 105464 802E3BE4 30620004 */  andi      $v0, $v1, 0x4
/* 105468 802E3BE8 10400016 */  beqz      $v0, .L802E3C44
/* 10546C 802E3BEC 30620080 */   andi     $v0, $v1, 0x80
/* 105470 802E3BF0 92240004 */  lbu       $a0, 0x4($s1)
/* 105474 802E3BF4 0C0441A9 */  jal       get_entity_type
/* 105478 802E3BF8 00000000 */   nop
/* 10547C 802E3BFC 0040182D */  daddu     $v1, $v0, $zero
/* 105480 802E3C00 2402000C */  addiu     $v0, $zero, 0xC
/* 105484 802E3C04 10620019 */  beq       $v1, $v0, .L802E3C6C
/* 105488 802E3C08 0062102A */   slt      $v0, $v1, $v0
/* 10548C 802E3C0C 14400005 */  bnez      $v0, .L802E3C24
/* 105490 802E3C10 2862001B */   slti     $v0, $v1, 0x1B
/* 105494 802E3C14 10400003 */  beqz      $v0, .L802E3C24
/* 105498 802E3C18 28620015 */   slti     $v0, $v1, 0x15
/* 10549C 802E3C1C 10400072 */  beqz      $v0, .L802E3DE8
/* 1054A0 802E3C20 0000102D */   daddu    $v0, $zero, $zero
.L802E3C24:
/* 1054A4 802E3C24 8E420000 */  lw        $v0, 0x0($s2)
/* 1054A8 802E3C28 30420002 */  andi      $v0, $v0, 0x2
/* 1054AC 802E3C2C 1040006E */  beqz      $v0, .L802E3DE8
/* 1054B0 802E3C30 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802E3C34
/* 1054B4 802E3C34 0C043F5A */  jal       exec_entity_commandlist
/* 1054B8 802E3C38 0220202D */   daddu    $a0, $s1, $zero
/* 1054BC 802E3C3C 080B8F7A */  j         .L802E3DE8
/* 1054C0 802E3C40 24020001 */   addiu    $v0, $zero, 0x1
.L802E3C44:
/* 1054C4 802E3C44 1440FFFB */  bnez      $v0, .L802E3C34
/* 1054C8 802E3C48 30620001 */   andi     $v0, $v1, 0x1
/* 1054CC 802E3C4C 1040000F */  beqz      $v0, .L802E3C8C
/* 1054D0 802E3C50 0000802D */   daddu    $s0, $zero, $zero
/* 1054D4 802E3C54 824300B4 */  lb        $v1, 0xB4($s2)
/* 1054D8 802E3C58 2402000D */  addiu     $v0, $zero, 0xD
/* 1054DC 802E3C5C 10620003 */  beq       $v1, $v0, .L802E3C6C
/* 1054E0 802E3C60 2402000F */   addiu    $v0, $zero, 0xF
/* 1054E4 802E3C64 14620003 */  bne       $v1, $v0, .L802E3C74
/* 1054E8 802E3C68 2402000E */   addiu    $v0, $zero, 0xE
.L802E3C6C:
/* 1054EC 802E3C6C 080B8F7A */  j         .L802E3DE8
/* 1054F0 802E3C70 0000102D */   daddu    $v0, $zero, $zero
.L802E3C74:
/* 1054F4 802E3C74 10620003 */  beq       $v1, $v0, .L802E3C84
/* 1054F8 802E3C78 24020010 */   addiu    $v0, $zero, 0x10
/* 1054FC 802E3C7C 1462005A */  bne       $v1, $v0, .L802E3DE8
/* 105500 802E3C80 24020001 */   addiu    $v0, $zero, 0x1
.L802E3C84:
/* 105504 802E3C84 080B8F2A */  j         .L802E3CA8
/* 105508 802E3C88 24100001 */   addiu    $s0, $zero, 0x1
.L802E3C8C:
/* 10550C 802E3C8C 30620040 */  andi      $v0, $v1, 0x40
/* 105510 802E3C90 10400054 */  beqz      $v0, .L802E3DE4
/* 105514 802E3C94 3C030100 */   lui      $v1, (0x1000000 >> 16)
/* 105518 802E3C98 8E420000 */  lw        $v0, 0x0($s2)
/* 10551C 802E3C9C 00431024 */  and       $v0, $v0, $v1
/* 105520 802E3CA0 10400051 */  beqz      $v0, .L802E3DE8
/* 105524 802E3CA4 24020001 */   addiu    $v0, $zero, 0x1
.L802E3CA8:
/* 105528 802E3CA8 92240004 */  lbu       $a0, 0x4($s1)
/* 10552C 802E3CAC 0C0441A9 */  jal       get_entity_type
/* 105530 802E3CB0 00000000 */   nop
/* 105534 802E3CB4 2443FFF5 */  addiu     $v1, $v0, -0xB
/* 105538 802E3CB8 2C620015 */  sltiu     $v0, $v1, 0x15
/* 10553C 802E3CBC 10400049 */  beqz      $v0, .L802E3DE4
/* 105540 802E3CC0 00031080 */   sll      $v0, $v1, 2
/* 105544 802E3CC4 3C01802F */  lui       $at, %hi(jtbl_802EB210)
/* 105548 802E3CC8 00220821 */  addu      $at, $at, $v0
/* 10554C 802E3CCC 8C22B210 */  lw        $v0, %lo(jtbl_802EB210)($at)
/* 105550 802E3CD0 00400008 */  jr        $v0
/* 105554 802E3CD4 00000000 */   nop
glabel .L802E3CD8
/* 105558 802E3CD8 12000007 */  beqz      $s0, .L802E3CF8
/* 10555C 802E3CDC 00000000 */   nop
/* 105560 802E3CE0 3C028011 */  lui       $v0, %hi(gPlayerData)
/* 105564 802E3CE4 8042F290 */  lb        $v0, %lo(gPlayerData)($v0)
/* 105568 802E3CE8 58400007 */  blezl     $v0, .L802E3D08
/* 10556C 802E3CEC 0000802D */   daddu    $s0, $zero, $zero
/* 105570 802E3CF0 080B8F42 */  j         .L802E3D08
/* 105574 802E3CF4 00000000 */   nop
.L802E3CF8:
/* 105578 802E3CF8 3C028011 */  lui       $v0, %hi(gPlayerData + 0x1)
/* 10557C 802E3CFC 8042F291 */  lb        $v0, %lo(gPlayerData + 0x1)($v0)
/* 105580 802E3D00 04430001 */  bgezl     $v0, .L802E3D08
/* 105584 802E3D04 24100001 */   addiu    $s0, $zero, 0x1
.L802E3D08:
/* 105588 802E3D08 12000037 */  beqz      $s0, .L802E3DE8
/* 10558C 802E3D0C 24020001 */   addiu    $v0, $zero, 0x1
/* 105590 802E3D10 3C05802F */  lui       $a1, %hi(D_802E9E80)
/* 105594 802E3D14 24A59E80 */  addiu     $a1, $a1, %lo(D_802E9E80)
/* 105598 802E3D18 0C043EF0 */  jal       set_entity_commandlist
/* 10559C 802E3D1C 0220202D */   daddu    $a0, $s1, $zero
/* 1055A0 802E3D20 C6200050 */  lwc1      $f0, 0x50($s1)
/* 1055A4 802E3D24 080B8F6C */  j         .L802E3DB0
/* 1055A8 802E3D28 2404014F */   addiu    $a0, $zero, 0x14F
glabel .L802E3D2C
/* 1055AC 802E3D2C 12000008 */  beqz      $s0, .L802E3D50
/* 1055B0 802E3D30 00000000 */   nop
/* 1055B4 802E3D34 3C028011 */  lui       $v0, %hi(gPlayerData)
/* 1055B8 802E3D38 8042F290 */  lb        $v0, %lo(gPlayerData)($v0)
/* 1055BC 802E3D3C 28420002 */  slti      $v0, $v0, 0x2
/* 1055C0 802E3D40 54400007 */  bnel      $v0, $zero, .L802E3D60
/* 1055C4 802E3D44 0000802D */   daddu    $s0, $zero, $zero
/* 1055C8 802E3D48 080B8F58 */  j         .L802E3D60
/* 1055CC 802E3D4C 00000000 */   nop
.L802E3D50:
/* 1055D0 802E3D50 3C028011 */  lui       $v0, %hi(gPlayerData + 0x1)
/* 1055D4 802E3D54 8042F291 */  lb        $v0, %lo(gPlayerData + 0x1)($v0)
/* 1055D8 802E3D58 5C400001 */  bgtzl     $v0, .L802E3D60
/* 1055DC 802E3D5C 24100001 */   addiu    $s0, $zero, 0x1
.L802E3D60:
/* 1055E0 802E3D60 12000021 */  beqz      $s0, .L802E3DE8
/* 1055E4 802E3D64 24020001 */   addiu    $v0, $zero, 0x1
/* 1055E8 802E3D68 3C05802F */  lui       $a1, %hi(D_802E9E80)
/* 1055EC 802E3D6C 24A59E80 */  addiu     $a1, $a1, %lo(D_802E9E80)
/* 1055F0 802E3D70 0C043EF0 */  jal       set_entity_commandlist
/* 1055F4 802E3D74 0220202D */   daddu    $a0, $s1, $zero
/* 1055F8 802E3D78 C6200050 */  lwc1      $f0, 0x50($s1)
/* 1055FC 802E3D7C 080B8F6C */  j         .L802E3DB0
/* 105600 802E3D80 24040150 */   addiu    $a0, $zero, 0x150
glabel .L802E3D84
/* 105604 802E3D84 3C028011 */  lui       $v0, %hi(gPlayerData + 0x1)
/* 105608 802E3D88 8042F291 */  lb        $v0, %lo(gPlayerData + 0x1)($v0)
/* 10560C 802E3D8C 28420002 */  slti      $v0, $v0, 0x2
/* 105610 802E3D90 14400015 */  bnez      $v0, .L802E3DE8
/* 105614 802E3D94 24020001 */   addiu    $v0, $zero, 0x1
/* 105618 802E3D98 3C05802F */  lui       $a1, %hi(D_802E9E80)
/* 10561C 802E3D9C 24A59E80 */  addiu     $a1, $a1, %lo(D_802E9E80)
/* 105620 802E3DA0 0C043EF0 */  jal       set_entity_commandlist
/* 105624 802E3DA4 0220202D */   daddu    $a0, $s1, $zero
/* 105628 802E3DA8 C6200050 */  lwc1      $f0, 0x50($s1)
/* 10562C 802E3DAC 24040151 */  addiu     $a0, $zero, 0x151
.L802E3DB0:
/* 105630 802E3DB0 E7A00010 */  swc1      $f0, 0x10($sp)
/* 105634 802E3DB4 8E260048 */  lw        $a2, 0x48($s1)
/* 105638 802E3DB8 8E27004C */  lw        $a3, 0x4C($s1)
/* 10563C 802E3DBC 0C052757 */  jal       sfx_play_sound_at_position
/* 105640 802E3DC0 0000282D */   daddu    $a1, $zero, $zero
/* 105644 802E3DC4 080B8F7A */  j         .L802E3DE8
/* 105648 802E3DC8 24020001 */   addiu    $v0, $zero, 0x1
glabel .L802E3DCC
/* 10564C 802E3DCC 0C04419E */  jal       entity_start_script
/* 105650 802E3DD0 0220202D */   daddu    $a0, $s1, $zero
/* 105654 802E3DD4 080B8F0D */  j         .L802E3C34
/* 105658 802E3DD8 00000000 */   nop
glabel .L802E3DDC
/* 10565C 802E3DDC 0C04419E */  jal       entity_start_script
/* 105660 802E3DE0 0220202D */   daddu    $a0, $s1, $zero
glabel .L802E3DE4
/* 105664 802E3DE4 24020001 */  addiu     $v0, $zero, 0x1
.L802E3DE8:
/* 105668 802E3DE8 8FBF0024 */  lw        $ra, 0x24($sp)
/* 10566C 802E3DEC 8FB20020 */  lw        $s2, 0x20($sp)
/* 105670 802E3DF0 8FB1001C */  lw        $s1, 0x1C($sp)
/* 105674 802E3DF4 8FB00018 */  lw        $s0, 0x18($sp)
/* 105678 802E3DF8 03E00008 */  jr        $ra
/* 10567C 802E3DFC 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

s32 entity_block_handle_collision(Entity* entity) {
    s32 breakBlock;
    PlayerStatus* playerStatus = &gPlayerStatus;

    if (entity->alpha == 0 && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) {
        return FALSE;
    }

    if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) {
        s32 type = get_entity_type(entity->listIndex);
        switch (type) {
            case ENTITY_TYPE_PUSH_BLOCK:
            case ENTITY_TYPE_HAMMER1_BLOCK:
            case ENTITY_TYPE_HAMMER2_BLOCK:
            case ENTITY_TYPE_HAMMER3_BLOCK:
            case ENTITY_TYPE_HAMMER1_BLOCK_TINY:
            case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
            case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
                return FALSE;
        }

        if (playerStatus->flags & PS_FLAG_JUMPING) {
            exec_entity_commandlist(entity);
        }
        return TRUE;
    }
    if (entity->collisionFlags & ENTITY_COLLISION_PARTNER) {
        exec_entity_commandlist(entity);
        return TRUE;
    }

    breakBlock = FALSE;
    if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) {
        if (playerStatus->actionState == ACTION_STATE_SPIN_JUMP || playerStatus->actionState == ACTION_STATE_TORNADO_JUMP) {
            return FALSE;
        }

        if (playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) {
            breakBlock = TRUE;
        } else {
            return TRUE;
        }
    } else {
        if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_HAMMER)) {
            return TRUE;
        }
        if (!(playerStatus->flags & PS_FLAG_HAMMER_CHECK)) {
            return TRUE;
        }
    }

    switch (get_entity_type(entity->listIndex)) {
        case ENTITY_TYPE_BRICK_BLOCK:
        case ENTITY_TYPE_MULTI_COIN_BRICK:
        case ENTITY_TYPE_YELLOW_BLOCK:
        case ENTITY_TYPE_SINGLE_TRIGGER_BLOCK:
        case ENTITY_TYPE_HIDDEN_YELLOW_BLOCK:
        case ENTITY_TYPE_HIDDEN_RED_BLOCK:
        case ENTITY_TYPE_RED_BLOCK:
            exec_entity_commandlist(entity);
            break;
        case ENTITY_TYPE_HAMMER1_BLOCK:
        case ENTITY_TYPE_HAMMER1_BLOCK_TINY:
            if (breakBlock) {
                if (gPlayerData.bootsLevel < 1) {
                    breakBlock = FALSE;
                }
            } else {
                if (gPlayerData.hammerLevel > -1) {
                    breakBlock = TRUE;
                }
            }
            if (!breakBlock) {
                return TRUE;
            }
            set_entity_commandlist(entity, Entity_BreakingBlock_Script);
            sfx_play_sound_at_position(SOUND_14F, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
            break;
        case ENTITY_TYPE_HAMMER2_BLOCK:
        case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
            if (breakBlock) {
                if (gPlayerData.bootsLevel < 2) {
                    breakBlock = FALSE;
                }
            } else if (gPlayerData.hammerLevel > 0) {
                breakBlock = TRUE;
            }
            if (!breakBlock) {
                return TRUE;
            }
            set_entity_commandlist(entity, Entity_BreakingBlock_Script);
            sfx_play_sound_at_position(SOUND_150, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
            break;
        case ENTITY_TYPE_HAMMER3_BLOCK:
        case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
            if (gPlayerData.hammerLevel < 2) {
                return TRUE;
            }
            set_entity_commandlist(entity, Entity_BreakingBlock_Script);
            sfx_play_sound_at_position(SOUND_151, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
            break;
        case ENTITY_TYPE_MULTI_TRIGGER_BLOCK:
        case ENTITY_TYPE_HEALING_BLOCK:
        case ENTITY_TYPE_1C:
        case ENTITY_TYPE_1D:
        case ENTITY_TYPE_1E:
        case ENTITY_TYPE_HEALING_BLOCK_FRAME:
            entity_start_script(entity);
            exec_entity_commandlist(entity);
            break;
        case ENTITY_TYPE_PUSH_BLOCK:
            entity_start_script(entity);
            break;
        case ENTITY_TYPE_INACTIVE_BLOCK:
            break;
    }

    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel SummonEnemy
/* 19C444 8026DB64 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 19C448 8026DB68 AFB20018 */  sw        $s2, 0x18($sp)
/* 19C44C 8026DB6C 0080902D */  daddu     $s2, $a0, $zero
/* 19C450 8026DB70 AFB10014 */  sw        $s1, 0x14($sp)
/* 19C454 8026DB74 3C11800E */  lui       $s1, %hi(gBattleStatus)
/* 19C458 8026DB78 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 19C45C 8026DB7C AFBF001C */  sw        $ra, 0x1C($sp)
/* 19C460 8026DB80 AFB00010 */  sw        $s0, 0x10($sp)
/* 19C464 8026DB84 8E50000C */  lw        $s0, 0xC($s2)
/* 19C468 8026DB88 54A00001 */  bnel      $a1, $zero, .L8026DB90
/* 19C46C 8026DB8C AE400070 */   sw       $zero, 0x70($s2)
.L8026DB90:
/* 19C470 8026DB90 8E430070 */  lw        $v1, 0x70($s2)
/* 19C474 8026DB94 10600005 */  beqz      $v1, .L8026DBAC
/* 19C478 8026DB98 24020001 */   addiu    $v0, $zero, 0x1
/* 19C47C 8026DB9C 10620011 */  beq       $v1, $v0, .L8026DBE4
/* 19C480 8026DBA0 0000102D */   daddu    $v0, $zero, $zero
/* 19C484 8026DBA4 0809B77A */  j         .L8026DDE8
/* 19C488 8026DBA8 00000000 */   nop
.L8026DBAC:
/* 19C48C 8026DBAC 8E050000 */  lw        $a1, 0x0($s0)
/* 19C490 8026DBB0 26100004 */  addiu     $s0, $s0, 0x4
/* 19C494 8026DBB4 0C0B1EAF */  jal       evt_get_variable
/* 19C498 8026DBB8 0240202D */   daddu    $a0, $s2, $zero
/* 19C49C 8026DBBC 0C0994E9 */  jal       create_actor
/* 19C4A0 8026DBC0 0040202D */   daddu    $a0, $v0, $zero
/* 19C4A4 8026DBC4 AE420074 */  sw        $v0, 0x74($s2)
/* 19C4A8 8026DBC8 8E050000 */  lw        $a1, 0x0($s0)
/* 19C4AC 8026DBCC 0C0B1EAF */  jal       evt_get_variable
/* 19C4B0 8026DBD0 0240202D */   daddu    $a0, $s2, $zero
/* 19C4B4 8026DBD4 AE420078 */  sw        $v0, 0x78($s2)
/* 19C4B8 8026DBD8 24020001 */  addiu     $v0, $zero, 0x1
/* 19C4BC 8026DBDC 0809B779 */  j         .L8026DDE4
/* 19C4C0 8026DBE0 AE420070 */   sw       $v0, 0x70($s2)
.L8026DBE4:
/* 19C4C4 8026DBE4 8E500074 */  lw        $s0, 0x74($s2)
/* 19C4C8 8026DBE8 0C0B1059 */  jal       does_script_exist
/* 19C4CC 8026DBEC 8E0401E4 */   lw       $a0, 0x1E4($s0)
/* 19C4D0 8026DBF0 1440007D */  bnez      $v0, .L8026DDE8
/* 19C4D4 8026DBF4 0000102D */   daddu    $v0, $zero, $zero
/* 19C4D8 8026DBF8 82220170 */  lb        $v0, 0x170($s1)
/* 19C4DC 8026DBFC 14400040 */  bnez      $v0, .L8026DD00
/* 19C4E0 8026DC00 262E0140 */   addiu    $t6, $s1, 0x140
/* 19C4E4 8026DC04 0000582D */  daddu     $t3, $zero, $zero
/* 19C4E8 8026DC08 0160202D */  daddu     $a0, $t3, $zero
/* 19C4EC 8026DC0C 0220282D */  daddu     $a1, $s1, $zero
/* 19C4F0 8026DC10 0220182D */  daddu     $v1, $s1, $zero
.L8026DC14:
/* 19C4F4 8026DC14 8CA200E0 */  lw        $v0, 0xE0($a1)
/* 19C4F8 8026DC18 50400006 */  beql      $v0, $zero, .L8026DC34
/* 19C4FC 8026DC1C 24840001 */   addiu    $a0, $a0, 0x1
/* 19C500 8026DC20 34820200 */  ori       $v0, $a0, 0x200
/* 19C504 8026DC24 A4620140 */  sh        $v0, 0x140($v1)
/* 19C508 8026DC28 24630002 */  addiu     $v1, $v1, 0x2
/* 19C50C 8026DC2C 256B0001 */  addiu     $t3, $t3, 0x1
/* 19C510 8026DC30 24840001 */  addiu     $a0, $a0, 0x1
.L8026DC34:
/* 19C514 8026DC34 28820018 */  slti      $v0, $a0, 0x18
/* 19C518 8026DC38 1440FFF6 */  bnez      $v0, .L8026DC14
/* 19C51C 8026DC3C 24A50004 */   addiu    $a1, $a1, 0x4
/* 19C520 8026DC40 A22B0171 */  sb        $t3, 0x171($s1)
/* 19C524 8026DC44 8E420078 */  lw        $v0, 0x78($s2)
/* 19C528 8026DC48 10400002 */  beqz      $v0, .L8026DC54
/* 19C52C 8026DC4C 240C03E8 */   addiu    $t4, $zero, 0x3E8
/* 19C530 8026DC50 240CFC18 */  addiu     $t4, $zero, -0x3E8
.L8026DC54:
/* 19C534 8026DC54 262E0140 */  addiu     $t6, $s1, 0x140
/* 19C538 8026DC58 2562FFFF */  addiu     $v0, $t3, -0x1
/* 19C53C 8026DC5C 1840005D */  blez      $v0, .L8026DDD4
/* 19C540 8026DC60 0000202D */   daddu    $a0, $zero, $zero
/* 19C544 8026DC64 0040782D */  daddu     $t7, $v0, $zero
/* 19C548 8026DC68 01C0682D */  daddu     $t5, $t6, $zero
.L8026DC6C:
/* 19C54C 8026DC6C 24880001 */  addiu     $t0, $a0, 0x1
/* 19C550 8026DC70 010B102A */  slt       $v0, $t0, $t3
/* 19C554 8026DC74 5040001D */  beql      $v0, $zero, .L8026DCEC
/* 19C558 8026DC78 24840001 */   addiu    $a0, $a0, 0x1
/* 19C55C 8026DC7C 01A0502D */  daddu     $t2, $t5, $zero
/* 19C560 8026DC80 00081040 */  sll       $v0, $t0, 1
/* 19C564 8026DC84 004E3821 */  addu      $a3, $v0, $t6
.L8026DC88:
/* 19C568 8026DC88 95490000 */  lhu       $t1, 0x0($t2)
/* 19C56C 8026DC8C 312200FF */  andi      $v0, $t1, 0xFF
/* 19C570 8026DC90 00021080 */  sll       $v0, $v0, 2
/* 19C574 8026DC94 02221021 */  addu      $v0, $s1, $v0
/* 19C578 8026DC98 8C4200E0 */  lw        $v0, 0xE0($v0)
/* 19C57C 8026DC9C 804501F1 */  lb        $a1, 0x1F1($v0)
/* 19C580 8026DCA0 50500001 */  beql      $v0, $s0, .L8026DCA8
/* 19C584 8026DCA4 00AC2821 */   addu     $a1, $a1, $t4
.L8026DCA8:
/* 19C588 8026DCA8 94E60000 */  lhu       $a2, 0x0($a3)
/* 19C58C 8026DCAC 30C200FF */  andi      $v0, $a2, 0xFF
pause_available_png:
/* 19C590 8026DCB0 00021080 */  sll       $v0, $v0, 2
/* 19C594 8026DCB4 02221021 */  addu      $v0, $s1, $v0
/* 19C598 8026DCB8 8C4200E0 */  lw        $v0, 0xE0($v0)
/* 19C59C 8026DCBC 804301F1 */  lb        $v1, 0x1F1($v0)
/* 19C5A0 8026DCC0 50500001 */  beql      $v0, $s0, .L8026DCC8
/* 19C5A4 8026DCC4 006C1821 */   addu     $v1, $v1, $t4
.L8026DCC8:
/* 19C5A8 8026DCC8 00A3102A */  slt       $v0, $a1, $v1
/* 19C5AC 8026DCCC 10400003 */  beqz      $v0, .L8026DCDC
/* 19C5B0 8026DCD0 25080001 */   addiu    $t0, $t0, 0x1
/* 19C5B4 8026DCD4 A5460000 */  sh        $a2, 0x0($t2)
/* 19C5B8 8026DCD8 A4E90000 */  sh        $t1, 0x0($a3)
.L8026DCDC:
/* 19C5BC 8026DCDC 010B102A */  slt       $v0, $t0, $t3
/* 19C5C0 8026DCE0 1440FFE9 */  bnez      $v0, .L8026DC88
/* 19C5C4 8026DCE4 24E70002 */   addiu    $a3, $a3, 0x2
/* 19C5C8 8026DCE8 24840001 */  addiu     $a0, $a0, 0x1
.L8026DCEC:
/* 19C5CC 8026DCEC 008F102A */  slt       $v0, $a0, $t7
/* 19C5D0 8026DCF0 1440FFDE */  bnez      $v0, .L8026DC6C
/* 19C5D4 8026DCF4 25AD0002 */   addiu    $t5, $t5, 0x2
/* 19C5D8 8026DCF8 0809B775 */  j         .L8026DDD4
/* 19C5DC 8026DCFC 00000000 */   nop
.L8026DD00:
/* 19C5E0 8026DD00 822B0171 */  lb        $t3, 0x171($s1)
/* 19C5E4 8026DD04 1960000D */  blez      $t3, .L8026DD3C
/* 19C5E8 8026DD08 0000202D */   daddu    $a0, $zero, $zero
/* 19C5EC 8026DD0C 2405FFFF */  addiu     $a1, $zero, -0x1
/* 19C5F0 8026DD10 01C0182D */  daddu     $v1, $t6, $zero
.L8026DD14:
/* 19C5F4 8026DD14 90620001 */  lbu       $v0, 0x1($v1)
/* 19C5F8 8026DD18 00021080 */  sll       $v0, $v0, 2
/* 19C5FC 8026DD1C 02221021 */  addu      $v0, $s1, $v0
/* 19C600 8026DD20 8C4200E0 */  lw        $v0, 0xE0($v0)
/* 19C604 8026DD24 50500001 */  beql      $v0, $s0, .L8026DD2C
/* 19C608 8026DD28 A4650000 */   sh       $a1, 0x0($v1)
.L8026DD2C:
/* 19C60C 8026DD2C 24840001 */  addiu     $a0, $a0, 0x1
/* 19C610 8026DD30 008B102A */  slt       $v0, $a0, $t3
/* 19C614 8026DD34 1440FFF7 */  bnez      $v0, .L8026DD14
/* 19C618 8026DD38 24630002 */   addiu    $v1, $v1, 0x2
.L8026DD3C:
/* 19C61C 8026DD3C 8E420078 */  lw        $v0, 0x78($s2)
/* 19C620 8026DD40 1440001C */  bnez      $v0, .L8026DDB4
/* 19C624 8026DD44 0160202D */   daddu    $a0, $t3, $zero
/* 19C628 8026DD48 82220170 */  lb        $v0, 0x170($s1)
/* 19C62C 8026DD4C 0082102A */  slt       $v0, $a0, $v0
/* 19C630 8026DD50 1440000B */  bnez      $v0, .L8026DD80
/* 19C634 8026DD54 00041840 */   sll      $v1, $a0, 1
.L8026DD58:
/* 19C638 8026DD58 2484FFFF */  addiu     $a0, $a0, -0x1
/* 19C63C 8026DD5C 00041040 */  sll       $v0, $a0, 1
/* 19C640 8026DD60 02221021 */  addu      $v0, $s1, $v0
/* 19C644 8026DD64 94420140 */  lhu       $v0, 0x140($v0)
/* 19C648 8026DD68 02231821 */  addu      $v1, $s1, $v1
/* 19C64C 8026DD6C A4620140 */  sh        $v0, 0x140($v1)
/* 19C650 8026DD70 82220170 */  lb        $v0, 0x170($s1)
/* 19C654 8026DD74 0082102A */  slt       $v0, $a0, $v0
/* 19C658 8026DD78 1040FFF7 */  beqz      $v0, .L8026DD58
/* 19C65C 8026DD7C 00041840 */   sll      $v1, $a0, 1
.L8026DD80:
/* 19C660 8026DD80 82220170 */  lb        $v0, 0x170($s1)
/* 19C664 8026DD84 96030192 */  lhu       $v1, 0x192($s0)
/* 19C668 8026DD88 2442FFFF */  addiu     $v0, $v0, -0x1
/* 19C66C 8026DD8C 00021040 */  sll       $v0, $v0, 1
/* 19C670 8026DD90 02221021 */  addu      $v0, $s1, $v0
/* 19C674 8026DD94 A4430140 */  sh        $v1, 0x140($v0)
/* 19C678 8026DD98 92220171 */  lbu       $v0, 0x171($s1)
/* 19C67C 8026DD9C 92230170 */  lbu       $v1, 0x170($s1)
/* 19C680 8026DDA0 24420001 */  addiu     $v0, $v0, 0x1
/* 19C684 8026DDA4 24630001 */  addiu     $v1, $v1, 0x1
/* 19C688 8026DDA8 A2220171 */  sb        $v0, 0x171($s1)
/* 19C68C 8026DDAC 0809B775 */  j         .L8026DDD4
/* 19C690 8026DDB0 A2230170 */   sb       $v1, 0x170($s1)
.L8026DDB4:
/* 19C694 8026DDB4 82220171 */  lb        $v0, 0x171($s1)
/* 19C698 8026DDB8 96030192 */  lhu       $v1, 0x192($s0)
/* 19C69C 8026DDBC 00021040 */  sll       $v0, $v0, 1
/* 19C6A0 8026DDC0 02221021 */  addu      $v0, $s1, $v0
/* 19C6A4 8026DDC4 A4430140 */  sh        $v1, 0x140($v0)
/* 19C6A8 8026DDC8 92220171 */  lbu       $v0, 0x171($s1)
/* 19C6AC 8026DDCC 24420001 */  addiu     $v0, $v0, 0x1
/* 19C6B0 8026DDD0 A2220171 */  sb        $v0, 0x171($s1)
.L8026DDD4:
/* 19C6B4 8026DDD4 86030192 */  lh        $v1, 0x192($s0)
/* 19C6B8 8026DDD8 24020002 */  addiu     $v0, $zero, 0x2
/* 19C6BC 8026DDDC 0809B77A */  j         .L8026DDE8
/* 19C6C0 8026DDE0 AE430084 */   sw       $v1, 0x84($s2)
.L8026DDE4:
/* 19C6C4 8026DDE4 0000102D */  daddu     $v0, $zero, $zero
.L8026DDE8:
/* 19C6C8 8026DDE8 8FBF001C */  lw        $ra, 0x1C($sp)
/* 19C6CC 8026DDEC 8FB20018 */  lw        $s2, 0x18($sp)
/* 19C6D0 8026DDF0 8FB10014 */  lw        $s1, 0x14($sp)
/* 19C6D4 8026DDF4 8FB00010 */  lw        $s0, 0x10($sp)
/* 19C6D8 8026DDF8 03E00008 */  jr        $ra
/* 19C6DC 8026DDFC 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) {
    BattleStatus* battleStatus = &gBattleStatus;
    s32* args = script->ptrReadPos;
    Actor* actor1;
    Actor* actor2;
    s16* enemyIDs;
    s32 numEnemies;
    s32 i, j;
    u16 enemyID1, enemyID2;
    s32 priority1, priority2;
    s32 tempPriority;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    switch (script->functionTemp[0]) {
        case 0:
            script->functionTempPtr[1] = create_actor((FormationRow*)evt_get_variable(script, *args++));
            script->functionTemp[2] = evt_get_variable(script, *args++);
            script->functionTemp[0] = 1;
            break;
        case 1:
            actor2 = script->functionTempPtr[1];
            if (does_script_exist(actor2->takeTurnScriptID)) {
                break;
            }

            enemyIDs = battleStatus->enemyIDs;
            if (battleStatus->nextEnemyIndex == 0) {
                numEnemies = 0;
                for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                    if (battleStatus->enemyActors[i]) {
                        battleStatus->enemyIDs[numEnemies++] = i | ACTOR_CLASS_ENEMY;
                    }
                }
                battleStatus->numEnemyActors = numEnemies;
                if (script->functionTemp[2] != 0) {
                    tempPriority = -1000;
                } else {
                    tempPriority = 1000;
                }
                enemyIDs = battleStatus->enemyIDs;
                for (i = 0; i < numEnemies - 1; i++) {
                    for (j = i + 1; j < numEnemies; j++) {
                        enemyID1 = enemyIDs[i];
                        actor1 = battleStatus->enemyActors[(u8) enemyID1];
                        priority1 = actor1->turnPriority;
                        if (actor1 == actor2) {
                            priority1 += tempPriority;
                        }
                        enemyID2 = enemyIDs[j];
                        actor1 = battleStatus->enemyActors[(u8) enemyID2];
                        priority2 = actor1->turnPriority;
                        if (actor1 == actor2) {
                            priority2 += tempPriority;
                        }
                        if (priority1 < priority2) {
                            enemyIDs[i] = enemyID2;
                            enemyIDs[j] = enemyID1;
                        }
                    }
                }
            } else {
                numEnemies = battleStatus->numEnemyActors;
                for (i = 0; i < numEnemies; i++){
                    if (battleStatus->enemyActors[(u8) enemyIDs[i]] == actor2) {
                        enemyIDs[i] = -1;
                    }
                }
                if (script->functionTemp[2] == 0) {
                    for (i = numEnemies; i >= battleStatus->nextEnemyIndex; i--) {
                        battleStatus->enemyIDs[i] = battleStatus->enemyIDs[i - 1];
                    }
                    battleStatus->enemyIDs[battleStatus->nextEnemyIndex - 1] = actor2->actorID;
                    battleStatus->numEnemyActors++;
                    battleStatus->nextEnemyIndex++;
                } else {
                    battleStatus->enemyIDs[battleStatus->numEnemyActors] = actor2->actorID;
                    battleStatus->numEnemyActors++;
                }
            }
            script->varTable[0] = actor2->actorID;
            return ApiStatus_DONE2;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel NpcFlyTo
/* F30AC 802CE6FC 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* F30B0 802CE700 AFB20020 */  sw        $s2, 0x20($sp)
/* F30B4 802CE704 0080902D */  daddu     $s2, $a0, $zero
/* F30B8 802CE708 AFB30024 */  sw        $s3, 0x24($sp)
/* F30BC 802CE70C 26530090 */  addiu     $s3, $s2, 0x90
/* F30C0 802CE710 AFB40028 */  sw        $s4, 0x28($sp)
/* F30C4 802CE714 26540094 */  addiu     $s4, $s2, 0x94
/* F30C8 802CE718 AFB5002C */  sw        $s5, 0x2C($sp)
/* F30CC 802CE71C AFBF0030 */  sw        $ra, 0x30($sp)
/* F30D0 802CE720 AFB1001C */  sw        $s1, 0x1C($sp)
/* F30D4 802CE724 AFB00018 */  sw        $s0, 0x18($sp)
/* F30D8 802CE728 F7B40038 */  sdc1      $f20, 0x38($sp)
/* F30DC 802CE72C 8E50000C */  lw        $s0, 0xC($s2)
/* F30E0 802CE730 10A0004A */  beqz      $a1, .L802CE85C
/* F30E4 802CE734 26550098 */   addiu    $s5, $s2, 0x98
/* F30E8 802CE738 8E050000 */  lw        $a1, 0x0($s0)
/* F30EC 802CE73C 0C0B1EAF */  jal       evt_get_variable
/* F30F0 802CE740 26100004 */   addiu    $s0, $s0, 0x4
/* F30F4 802CE744 0240202D */  daddu     $a0, $s2, $zero
/* F30F8 802CE748 0C0B36B0 */  jal       resolve_npc
/* F30FC 802CE74C 0040282D */   daddu    $a1, $v0, $zero
/* F3100 802CE750 0040882D */  daddu     $s1, $v0, $zero
/* F3104 802CE754 56200003 */  bnel      $s1, $zero, .L802CE764
/* F3108 802CE758 AE510074 */   sw       $s1, 0x74($s2)
/* F310C 802CE75C 080B3A7A */  j         .L802CE9E8
/* F3110 802CE760 24020002 */   addiu    $v0, $zero, 0x2
.L802CE764:
/* F3114 802CE764 8E050000 */  lw        $a1, 0x0($s0)
/* F3118 802CE768 26100004 */  addiu     $s0, $s0, 0x4
/* F311C 802CE76C 0C0B210B */  jal       evt_get_float_variable
/* F3120 802CE770 0240202D */   daddu    $a0, $s2, $zero
/* F3124 802CE774 E6200060 */  swc1      $f0, 0x60($s1)
/* F3128 802CE778 8E050000 */  lw        $a1, 0x0($s0)
/* F312C 802CE77C 26100004 */  addiu     $s0, $s0, 0x4
/* F3130 802CE780 0C0B210B */  jal       evt_get_float_variable
/* F3134 802CE784 0240202D */   daddu    $a0, $s2, $zero
/* F3138 802CE788 E6200064 */  swc1      $f0, 0x64($s1)
/* F313C 802CE78C 8E050000 */  lw        $a1, 0x0($s0)
/* F3140 802CE790 26100004 */  addiu     $s0, $s0, 0x4
/* F3144 802CE794 0C0B210B */  jal       evt_get_float_variable
/* F3148 802CE798 0240202D */   daddu    $a0, $s2, $zero
/* F314C 802CE79C E6200068 */  swc1      $f0, 0x68($s1)
/* F3150 802CE7A0 8E050000 */  lw        $a1, 0x0($s0)
/* F3154 802CE7A4 26100004 */  addiu     $s0, $s0, 0x4
/* F3158 802CE7A8 0C0B1EAF */  jal       evt_get_variable
/* F315C 802CE7AC 0240202D */   daddu    $a0, $s2, $zero
/* F3160 802CE7B0 AE42009C */  sw        $v0, 0x9C($s2)
/* F3164 802CE7B4 8E050000 */  lw        $a1, 0x0($s0)
/* F3168 802CE7B8 26100004 */  addiu     $s0, $s0, 0x4
/* F316C 802CE7BC 0C0B1EAF */  jal       evt_get_variable
/* F3170 802CE7C0 0240202D */   daddu    $a0, $s2, $zero
/* F3174 802CE7C4 AE420078 */  sw        $v0, 0x78($s2)
/* F3178 802CE7C8 8E050000 */  lw        $a1, 0x0($s0)
/* F317C 802CE7CC 0C0B1EAF */  jal       evt_get_variable
/* F3180 802CE7D0 0240202D */   daddu    $a0, $s2, $zero
/* F3184 802CE7D4 AE42007C */  sw        $v0, 0x7C($s2)
/* F3188 802CE7D8 C6200038 */  lwc1      $f0, 0x38($s1)
/* F318C 802CE7DC A620008E */  sh        $zero, 0x8E($s1)
/* F3190 802CE7E0 E6400090 */  swc1      $f0, 0x90($s2)
/* F3194 802CE7E4 C620003C */  lwc1      $f0, 0x3C($s1)
/* F3198 802CE7E8 E6400094 */  swc1      $f0, 0x94($s2)
/* F319C 802CE7EC C6200040 */  lwc1      $f0, 0x40($s1)
/* F31A0 802CE7F0 E6400098 */  swc1      $f0, 0x98($s2)
/* F31A4 802CE7F4 C62C0038 */  lwc1      $f12, 0x38($s1)
/* F31A8 802CE7F8 C62E0040 */  lwc1      $f14, 0x40($s1)
/* F31AC 802CE7FC 8E260060 */  lw        $a2, 0x60($s1)
/* F31B0 802CE800 0C00A720 */  jal       atan2
/* F31B4 802CE804 8E270068 */   lw       $a3, 0x68($s1)
/* F31B8 802CE808 C62C0038 */  lwc1      $f12, 0x38($s1)
/* F31BC 802CE80C C62E0040 */  lwc1      $f14, 0x40($s1)
/* F31C0 802CE810 8E260060 */  lw        $a2, 0x60($s1)
/* F31C4 802CE814 8E270068 */  lw        $a3, 0x68($s1)
/* F31C8 802CE818 0C00A7B5 */  jal       dist2D
/* F31CC 802CE81C E620000C */   swc1     $f0, 0xC($s1)
/* F31D0 802CE820 46000086 */  mov.s     $f2, $f0
/* F31D4 802CE824 E6220010 */  swc1      $f2, 0x10($s1)
/* F31D8 802CE828 8E42009C */  lw        $v0, 0x9C($s2)
/* F31DC 802CE82C 14400006 */  bnez      $v0, .L802CE848
/* F31E0 802CE830 00000000 */   nop
/* F31E4 802CE834 C6200018 */  lwc1      $f0, 0x18($s1)
/* F31E8 802CE838 46001003 */  div.s     $f0, $f2, $f0
/* F31EC 802CE83C 4600018D */  trunc.w.s $f6, $f0
/* F31F0 802CE840 080B3A17 */  j         .L802CE85C
/* F31F4 802CE844 E646009C */   swc1     $f6, 0x9C($s2)
.L802CE848:
/* F31F8 802CE848 44820000 */  mtc1      $v0, $f0
/* F31FC 802CE84C 00000000 */  nop
/* F3200 802CE850 46800020 */  cvt.s.w   $f0, $f0
/* F3204 802CE854 46001003 */  div.s     $f0, $f2, $f0
/* F3208 802CE858 E6200018 */  swc1      $f0, 0x18($s1)
.L802CE85C:
/* F320C 802CE85C 8E510074 */  lw        $s1, 0x74($s2)
/* F3210 802CE860 8E42009C */  lw        $v0, 0x9C($s2)
/* F3214 802CE864 8627008E */  lh        $a3, 0x8E($s1)
/* F3218 802CE868 AFA20010 */  sw        $v0, 0x10($sp)
/* F321C 802CE86C 8E44007C */  lw        $a0, 0x7C($s2)
/* F3220 802CE870 8E650000 */  lw        $a1, 0x0($s3)
/* F3224 802CE874 0C00A8ED */  jal       update_lerp
/* F3228 802CE878 8E260060 */   lw       $a2, 0x60($s1)
/* F322C 802CE87C E6200038 */  swc1      $f0, 0x38($s1)
/* F3230 802CE880 8E42009C */  lw        $v0, 0x9C($s2)
/* F3234 802CE884 8627008E */  lh        $a3, 0x8E($s1)
/* F3238 802CE888 AFA20010 */  sw        $v0, 0x10($sp)
/* F323C 802CE88C 8E44007C */  lw        $a0, 0x7C($s2)
/* F3240 802CE890 8E850000 */  lw        $a1, 0x0($s4)
/* F3244 802CE894 0C00A8ED */  jal       update_lerp
/* F3248 802CE898 8E260064 */   lw       $a2, 0x64($s1)
/* F324C 802CE89C E620003C */  swc1      $f0, 0x3C($s1)
/* F3250 802CE8A0 8E42009C */  lw        $v0, 0x9C($s2)
/* F3254 802CE8A4 8627008E */  lh        $a3, 0x8E($s1)
/* F3258 802CE8A8 AFA20010 */  sw        $v0, 0x10($sp)
/* F325C 802CE8AC 8E44007C */  lw        $a0, 0x7C($s2)
/* F3260 802CE8B0 8EA50000 */  lw        $a1, 0x0($s5)
/* F3264 802CE8B4 0C00A8ED */  jal       update_lerp
/* F3268 802CE8B8 8E260068 */   lw       $a2, 0x68($s1)
/* F326C 802CE8BC 9622008E */  lhu       $v0, 0x8E($s1)
/* F3270 802CE8C0 E6200040 */  swc1      $f0, 0x40($s1)
/* F3274 802CE8C4 24420001 */  addiu     $v0, $v0, 0x1
/* F3278 802CE8C8 A622008E */  sh        $v0, 0x8E($s1)
/* F327C 802CE8CC 00021400 */  sll       $v0, $v0, 16
/* F3280 802CE8D0 8E43009C */  lw        $v1, 0x9C($s2)
/* F3284 802CE8D4 00021403 */  sra       $v0, $v0, 16
/* F3288 802CE8D8 0043102A */  slt       $v0, $v0, $v1
/* F328C 802CE8DC 14400008 */  bnez      $v0, .L802CE900
/* F3290 802CE8E0 24020002 */   addiu    $v0, $zero, 0x2
/* F3294 802CE8E4 C6200060 */  lwc1      $f0, 0x60($s1)
/* F3298 802CE8E8 C6220064 */  lwc1      $f2, 0x64($s1)
/* F329C 802CE8EC C6240068 */  lwc1      $f4, 0x68($s1)
/* F32A0 802CE8F0 E6200038 */  swc1      $f0, 0x38($s1)
/* F32A4 802CE8F4 E622003C */  swc1      $f2, 0x3C($s1)
/* F32A8 802CE8F8 080B3A7A */  j         .L802CE9E8
/* F32AC 802CE8FC E6240040 */   swc1     $f4, 0x40($s1)
.L802CE900:
/* F32B0 802CE900 C62C0038 */  lwc1      $f12, 0x38($s1)
/* F32B4 802CE904 C62E0040 */  lwc1      $f14, 0x40($s1)
/* F32B8 802CE908 8E260060 */  lw        $a2, 0x60($s1)
/* F32BC 802CE90C 0C00A7B5 */  jal       dist2D
/* F32C0 802CE910 8E270068 */   lw       $a3, 0x68($s1)
/* F32C4 802CE914 4480A000 */  mtc1      $zero, $f20
/* F32C8 802CE918 00000000 */  nop
/* F32CC 802CE91C 46140032 */  c.eq.s    $f0, $f20
/* F32D0 802CE920 00000000 */  nop
/* F32D4 802CE924 45000003 */  bc1f      .L802CE934
/* F32D8 802CE928 46000086 */   mov.s    $f2, $f0
/* F32DC 802CE92C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F32E0 802CE930 44811000 */  mtc1      $at, $f2
.L802CE934:
/* F32E4 802CE934 C6200010 */  lwc1      $f0, 0x10($s1)
/* F32E8 802CE938 46140032 */  c.eq.s    $f0, $f20
/* F32EC 802CE93C 00000000 */  nop
/* F32F0 802CE940 45000006 */  bc1f      .L802CE95C
/* F32F4 802CE944 00000000 */   nop
/* F32F8 802CE948 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F32FC 802CE94C 44810000 */  mtc1      $at, $f0
/* F3300 802CE950 00000000 */  nop
/* F3304 802CE954 E6200010 */  swc1      $f0, 0x10($s1)
/* F3308 802CE958 C6200010 */  lwc1      $f0, 0x10($s1)
.L802CE95C:
/* F330C 802CE95C 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* F3310 802CE960 44816800 */  mtc1      $at, $f13
/* F3314 802CE964 44806000 */  mtc1      $zero, $f12
/* F3318 802CE968 46001003 */  div.s     $f0, $f2, $f0
/* F331C 802CE96C 46000021 */  cvt.d.s   $f0, $f0
/* F3320 802CE970 46206301 */  sub.d     $f12, $f12, $f0
/* F3324 802CE974 3C01802E */  lui       $at, %hi(D_802DA1E0)
/* F3328 802CE978 D420A1E0 */  ldc1      $f0, %lo(D_802DA1E0)($at)
/* F332C 802CE97C 46206302 */  mul.d     $f12, $f12, $f0
/* F3330 802CE980 00000000 */  nop
/* F3334 802CE984 0C00A8BB */  jal       sin_deg
/* F3338 802CE988 46206320 */   cvt.s.d  $f12, $f12
/* F333C 802CE98C 8E440078 */  lw        $a0, 0x78($s2)
/* F3340 802CE990 14800002 */  bnez      $a0, .L802CE99C
/* F3344 802CE994 46000106 */   mov.s    $f4, $f0
/* F3348 802CE998 4600A106 */  mov.s     $f4, $f20
.L802CE99C:
/* F334C 802CE99C 04810007 */  bgez      $a0, .L802CE9BC
/* F3350 802CE9A0 00041023 */   negu     $v0, $a0
/* F3354 802CE9A4 44821000 */  mtc1      $v0, $f2
/* F3358 802CE9A8 00000000 */  nop
/* F335C 802CE9AC 468010A0 */  cvt.s.w   $f2, $f2
/* F3360 802CE9B0 46002007 */  neg.s     $f0, $f4
/* F3364 802CE9B4 46020102 */  mul.s     $f4, $f0, $f2
/* F3368 802CE9B8 00000000 */  nop
.L802CE9BC:
/* F336C 802CE9BC 18800006 */  blez      $a0, .L802CE9D8
/* F3370 802CE9C0 00000000 */   nop
/* F3374 802CE9C4 44840000 */  mtc1      $a0, $f0
/* F3378 802CE9C8 00000000 */  nop
/* F337C 802CE9CC 46800020 */  cvt.s.w   $f0, $f0
/* F3380 802CE9D0 46002102 */  mul.s     $f4, $f4, $f0
/* F3384 802CE9D4 00000000 */  nop
.L802CE9D8:
/* F3388 802CE9D8 C620003C */  lwc1      $f0, 0x3C($s1)
/* F338C 802CE9DC 46040000 */  add.s     $f0, $f0, $f4
/* F3390 802CE9E0 0000102D */  daddu     $v0, $zero, $zero
/* F3394 802CE9E4 E620003C */  swc1      $f0, 0x3C($s1)
.L802CE9E8:
/* F3398 802CE9E8 8FBF0030 */  lw        $ra, 0x30($sp)
/* F339C 802CE9EC 8FB5002C */  lw        $s5, 0x2C($sp)
/* F33A0 802CE9F0 8FB40028 */  lw        $s4, 0x28($sp)
/* F33A4 802CE9F4 8FB30024 */  lw        $s3, 0x24($sp)
/* F33A8 802CE9F8 8FB20020 */  lw        $s2, 0x20($sp)
/* F33AC 802CE9FC 8FB1001C */  lw        $s1, 0x1C($sp)
/* F33B0 802CEA00 8FB00018 */  lw        $s0, 0x18($sp)
/* F33B4 802CEA04 D7B40038 */  ldc1      $f20, 0x38($sp)
/* F33B8 802CEA08 03E00008 */  jr        $ra
/* F33BC 802CEA0C 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

ApiStatus NpcFlyTo(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    f32* outX = (f32*)&script->varTable[3];
    f32* outY = (f32*)&script->varTable[4];
    f32* outZ = (f32*)&script->varTable[5];
    Npc* npc;
    f32 dist;
    f32 yDelta;

    if (isInitialCall) {
        npc = resolve_npc(script, evt_get_variable(script, *args++));
        if (npc == NULL) {
            return ApiStatus_DONE2;
        }

        script->functionTempPtr[1] = npc;
        npc->moveToPos.x = evt_get_float_variable(script, *args++);
        npc->moveToPos.y = evt_get_float_variable(script, *args++);
        npc->moveToPos.z = evt_get_float_variable(script, *args++);
        script->varTable[6] = evt_get_variable(script, *args++);
        script->functionTemp[2] = evt_get_variable(script, *args++);
        script->functionTemp[3] = evt_get_variable(script, *args++);
        npc->duration = 0;
        *outX = npc->pos.x;
        *outY = npc->pos.y;
        *outZ = npc->pos.z;
        npc->yaw = atan2(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
        dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
        npc->planarFlyDist = dist;

        if (script->varTable[6] == 0) {
            script->varTable[6] = (dist / npc->moveSpeed);
        } else {
            npc->moveSpeed = dist / script->varTable[6];
        }
    }

    npc = script->functionTempPtr[1];
    npc->pos.x = update_lerp(script->functionTemp[3], *outX, npc->moveToPos.x, npc->duration, script->varTable[6]);
    npc->pos.y = update_lerp(script->functionTemp[3], *outY, npc->moveToPos.y, npc->duration, script->varTable[6]);
    npc->pos.z = update_lerp(script->functionTemp[3], *outZ, npc->moveToPos.z, npc->duration, script->varTable[6]);

    npc->duration++;
    if (npc->duration >= script->varTable[6]) {
        npc->pos.x = npc->moveToPos.x;
        npc->pos.y = npc->moveToPos.y;
        npc->pos.z = npc->moveToPos.z;
        return ApiStatus_DONE2;
    }

    dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
    if (dist == 0.0f) {
        dist = 1.0f;
    }
    if (npc->planarFlyDist == 0.0f) {
        npc->planarFlyDist = 1.0f;
    }

    yDelta = sin_deg((1.0 - (dist / npc->planarFlyDist)) * 180.0);
    if (script->functionTemp[2] == 0) {
        yDelta = 0.0f;
    }
    if (script->functionTemp[2] < 0) {
        yDelta = -yDelta * -script->functionTemp[2];
    }
    if (script->functionTemp[2] > 0) {
        yDelta *= script->functionTemp[2];
    }
    npc->pos.y += yDelta;
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_camera_mode_unused
/* B0E0 8002FCE0 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* B0E4 8002FCE4 AFB00010 */  sw        $s0, 0x10($sp)
/* B0E8 8002FCE8 0080802D */  daddu     $s0, $a0, $zero
/* B0EC 8002FCEC AFBF0014 */  sw        $ra, 0x14($sp)
/* B0F0 8002FCF0 F7BE0040 */  sdc1      $f30, 0x40($sp)
/* B0F4 8002FCF4 F7BC0038 */  sdc1      $f28, 0x38($sp)
/* B0F8 8002FCF8 F7BA0030 */  sdc1      $f26, 0x30($sp)
/* B0FC 8002FCFC F7B80028 */  sdc1      $f24, 0x28($sp)
/* B100 8002FD00 F7B60020 */  sdc1      $f22, 0x20($sp)
/* B104 8002FD04 F7B40018 */  sdc1      $f20, 0x18($sp)
/* B108 8002FD08 86020006 */  lh        $v0, 0x6($s0)
/* B10C 8002FD0C 3C038011 */  lui       $v1, %hi(gPlayerStatus)
/* B110 8002FD10 2463EFC8 */  addiu     $v1, $v1, %lo(gPlayerStatus)
/* B114 8002FD14 14400004 */  bnez      $v0, .L8002FD28
/* B118 8002FD18 00000000 */   nop
/* B11C 8002FD1C 86020008 */  lh        $v0, 0x8($s0)
/* B120 8002FD20 1040000F */  beqz      $v0, .L8002FD60
/* B124 8002FD24 00000000 */   nop
.L8002FD28:
/* B128 8002FD28 C6000054 */  lwc1      $f0, 0x54($s0)
/* B12C 8002FD2C C6020058 */  lwc1      $f2, 0x58($s0)
/* B130 8002FD30 C604005C */  lwc1      $f4, 0x5C($s0)
/* B134 8002FD34 24020064 */  addiu     $v0, $zero, 0x64
/* B138 8002FD38 A6000006 */  sh        $zero, 0x6($s0)
/* B13C 8002FD3C A6000008 */  sh        $zero, 0x8($s0)
/* B140 8002FD40 A600001C */  sh        $zero, 0x1C($s0)
/* B144 8002FD44 A602001E */  sh        $v0, 0x1E($s0)
/* B148 8002FD48 A6020020 */  sh        $v0, 0x20($s0)
/* B14C 8002FD4C A6000022 */  sh        $zero, 0x22($s0)
/* B150 8002FD50 A6000024 */  sh        $zero, 0x24($s0)
/* B154 8002FD54 E6000048 */  swc1      $f0, 0x48($s0)
/* B158 8002FD58 E602004C */  swc1      $f2, 0x4C($s0)
/* B15C 8002FD5C E6040050 */  swc1      $f4, 0x50($s0)
.L8002FD60:
/* B160 8002FD60 8C620000 */  lw        $v0, 0x0($v1)
/* B164 8002FD64 30420006 */  andi      $v0, $v0, 0x6
/* B168 8002FD68 14400007 */  bnez      $v0, .L8002FD88
/* B16C 8002FD6C 00000000 */   nop
/* B170 8002FD70 C460002C */  lwc1      $f0, 0x2C($v1)
/* B174 8002FD74 3C014270 */  lui       $at, (0x42700000 >> 16)
/* B178 8002FD78 44811000 */  mtc1      $at, $f2
/* B17C 8002FD7C 00000000 */  nop
/* B180 8002FD80 46020000 */  add.s     $f0, $f0, $f2
/* B184 8002FD84 E6000058 */  swc1      $f0, 0x58($s0)
.L8002FD88:
/* B188 8002FD88 C4600028 */  lwc1      $f0, 0x28($v1)
/* B18C 8002FD8C 3C0143C8 */  lui       $at, (0x43C80000 >> 16)
/* B190 8002FD90 44811000 */  mtc1      $at, $f2
/* B194 8002FD94 E6000054 */  swc1      $f0, 0x54($s0)
/* B198 8002FD98 C4600030 */  lwc1      $f0, 0x30($v1)
/* B19C 8002FD9C 46020000 */  add.s     $f0, $f0, $f2
/* B1A0 8002FDA0 8602001C */  lh        $v0, 0x1C($s0)
/* B1A4 8002FDA4 14400062 */  bnez      $v0, .L8002FF30
/* B1A8 8002FDA8 E600005C */   swc1     $f0, 0x5C($s0)
/* B1AC 8002FDAC 86030020 */  lh        $v1, 0x20($s0)
/* B1B0 8002FDB0 24022710 */  addiu     $v0, $zero, 0x2710
/* B1B4 8002FDB4 14600002 */  bnez      $v1, .L8002FDC0
/* B1B8 8002FDB8 0043001A */   div      $zero, $v0, $v1
/* B1BC 8002FDBC 0007000D */  break     7
.L8002FDC0:
/* B1C0 8002FDC0 2401FFFF */  addiu     $at, $zero, -0x1
/* B1C4 8002FDC4 14610004 */  bne       $v1, $at, .L8002FDD8
/* B1C8 8002FDC8 3C018000 */   lui      $at, (0x80000000 >> 16)
/* B1CC 8002FDCC 14410002 */  bne       $v0, $at, .L8002FDD8
/* B1D0 8002FDD0 00000000 */   nop
/* B1D4 8002FDD4 0006000D */  break     6
.L8002FDD8:
/* B1D8 8002FDD8 00002012 */  mflo      $a0
/* B1DC 8002FDDC C6000054 */  lwc1      $f0, 0x54($s0)
/* B1E0 8002FDE0 C6020058 */  lwc1      $f2, 0x58($s0)
/* B1E4 8002FDE4 C604005C */  lwc1      $f4, 0x5C($s0)
/* B1E8 8002FDE8 86020024 */  lh        $v0, 0x24($s0)
/* B1EC 8002FDEC 8603001E */  lh        $v1, 0x1E($s0)
/* B1F0 8002FDF0 E6000048 */  swc1      $f0, 0x48($s0)
/* B1F4 8002FDF4 44820000 */  mtc1      $v0, $f0
/* B1F8 8002FDF8 00000000 */  nop
/* B1FC 8002FDFC 46800020 */  cvt.s.w   $f0, $f0
/* B200 8002FE00 86020022 */  lh        $v0, 0x22($s0)
/* B204 8002FE04 E602004C */  swc1      $f2, 0x4C($s0)
/* B208 8002FE08 E6040050 */  swc1      $f4, 0x50($s0)
/* B20C 8002FE0C E6000084 */  swc1      $f0, 0x84($s0)
/* B210 8002FE10 44820000 */  mtc1      $v0, $f0
/* B214 8002FE14 00000000 */  nop
/* B218 8002FE18 46800020 */  cvt.s.w   $f0, $f0
/* B21C 8002FE1C E6000074 */  swc1      $f0, 0x74($s0)
/* B220 8002FE20 44830000 */  mtc1      $v1, $f0
/* B224 8002FE24 00000000 */  nop
/* B228 8002FE28 46800020 */  cvt.s.w   $f0, $f0
/* B22C 8002FE2C 04810002 */  bgez      $a0, .L8002FE38
/* B230 8002FE30 E6000078 */   swc1     $f0, 0x78($s0)
/* B234 8002FE34 24840003 */  addiu     $a0, $a0, 0x3
.L8002FE38:
/* B238 8002FE38 C6020074 */  lwc1      $f2, 0x74($s0)
/* B23C 8002FE3C 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* B240 8002FE40 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* B244 8002FE44 4481A000 */  mtc1      $at, $f20
/* B248 8002FE48 00041083 */  sra       $v0, $a0, 2
/* B24C 8002FE4C 46141082 */  mul.s     $f2, $f2, $f20
/* B250 8002FE50 00000000 */  nop
/* B254 8002FE54 4480F000 */  mtc1      $zero, $f30
/* B258 8002FE58 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* B25C 8002FE5C 4481B000 */  mtc1      $at, $f22
/* B260 8002FE60 44820000 */  mtc1      $v0, $f0
/* B264 8002FE64 00000000 */  nop
/* B268 8002FE68 46800020 */  cvt.s.w   $f0, $f0
/* B26C 8002FE6C E6000018 */  swc1      $f0, 0x18($s0)
/* B270 8002FE70 46161683 */  div.s     $f26, $f2, $f22
/* B274 8002FE74 0C00A85B */  jal       sin_rad
/* B278 8002FE78 4600D306 */   mov.s    $f12, $f26
/* B27C 8002FE7C 46000706 */  mov.s     $f28, $f0
/* B280 8002FE80 0C00A874 */  jal       cos_rad
/* B284 8002FE84 4600D306 */   mov.s    $f12, $f26
/* B288 8002FE88 461E0202 */  mul.s     $f8, $f0, $f30
/* B28C 8002FE8C 00000000 */  nop
/* B290 8002FE90 4600F087 */  neg.s     $f2, $f30
/* B294 8002FE94 4602E082 */  mul.s     $f2, $f28, $f2
/* B298 8002FE98 00000000 */  nop
/* B29C 8002FE9C C6180078 */  lwc1      $f24, 0x78($s0)
/* B2A0 8002FEA0 461CC102 */  mul.s     $f4, $f24, $f28
/* B2A4 8002FEA4 00000000 */  nop
/* B2A8 8002FEA8 4600C182 */  mul.s     $f6, $f24, $f0
/* B2AC 8002FEAC 00000000 */  nop
/* B2B0 8002FEB0 C6000084 */  lwc1      $f0, 0x84($s0)
/* B2B4 8002FEB4 46140002 */  mul.s     $f0, $f0, $f20
/* B2B8 8002FEB8 00000000 */  nop
/* B2BC 8002FEBC 4600F286 */  mov.s     $f10, $f30
/* B2C0 8002FEC0 46005506 */  mov.s     $f20, $f10
/* B2C4 8002FEC4 46044780 */  add.s     $f30, $f8, $f4
/* B2C8 8002FEC8 46061600 */  add.s     $f24, $f2, $f6
/* B2CC 8002FECC 46160683 */  div.s     $f26, $f0, $f22
/* B2D0 8002FED0 0C00A85B */  jal       sin_rad
/* B2D4 8002FED4 4600D306 */   mov.s    $f12, $f26
/* B2D8 8002FED8 46000706 */  mov.s     $f28, $f0
/* B2DC 8002FEDC 0C00A874 */  jal       cos_rad
/* B2E0 8002FEE0 4600D306 */   mov.s    $f12, $f26
/* B2E4 8002FEE4 46140182 */  mul.s     $f6, $f0, $f20
/* B2E8 8002FEE8 00000000 */  nop
/* B2EC 8002FEEC 4614E102 */  mul.s     $f4, $f28, $f20
/* B2F0 8002FEF0 00000000 */  nop
/* B2F4 8002FEF4 461CC082 */  mul.s     $f2, $f24, $f28
/* B2F8 8002FEF8 00000000 */  nop
/* B2FC 8002FEFC 4600C002 */  mul.s     $f0, $f24, $f0
/* B300 8002FF00 00000000 */  nop
/* B304 8002FF04 46023281 */  sub.s     $f10, $f6, $f2
/* B308 8002FF08 46002100 */  add.s     $f4, $f4, $f0
/* B30C 8002FF0C C600004C */  lwc1      $f0, 0x4C($s0)
/* B310 8002FF10 461E0000 */  add.s     $f0, $f0, $f30
/* B314 8002FF14 C6060048 */  lwc1      $f6, 0x48($s0)
/* B318 8002FF18 460A3180 */  add.s     $f6, $f6, $f10
/* B31C 8002FF1C C6020050 */  lwc1      $f2, 0x50($s0)
/* B320 8002FF20 46041080 */  add.s     $f2, $f2, $f4
/* B324 8002FF24 E6000040 */  swc1      $f0, 0x40($s0)
/* B328 8002FF28 E606003C */  swc1      $f6, 0x3C($s0)
/* B32C 8002FF2C E6020044 */  swc1      $f2, 0x44($s0)
.L8002FF30:
/* B330 8002FF30 C60C003C */  lwc1      $f12, 0x3C($s0)
/* B334 8002FF34 C60E0044 */  lwc1      $f14, 0x44($s0)
/* B338 8002FF38 8E060048 */  lw        $a2, 0x48($s0)
/* B33C 8002FF3C 0C00A720 */  jal       atan2
/* B340 8002FF40 8E070050 */   lw       $a3, 0x50($s0)
/* B344 8002FF44 C6040048 */  lwc1      $f4, 0x48($s0)
/* B348 8002FF48 4480B000 */  mtc1      $zero, $f22
/* B34C 8002FF4C C602003C */  lwc1      $f2, 0x3C($s0)
/* B350 8002FF50 E600006C */  swc1      $f0, 0x6C($s0)
/* B354 8002FF54 46022501 */  sub.s     $f20, $f4, $f2
/* B358 8002FF58 C6040050 */  lwc1      $f4, 0x50($s0)
/* B35C 8002FF5C C6020044 */  lwc1      $f2, 0x44($s0)
/* B360 8002FF60 4600B306 */  mov.s     $f12, $f22
/* B364 8002FF64 46022601 */  sub.s     $f24, $f4, $f2
/* B368 8002FF68 C604004C */  lwc1      $f4, 0x4C($s0)
/* B36C 8002FF6C C6020040 */  lwc1      $f2, 0x40($s0)
/* B370 8002FF70 4406A000 */  mfc1      $a2, $f20
/* B374 8002FF74 46022781 */  sub.s     $f30, $f4, $f2
/* B378 8002FF78 4407C000 */  mfc1      $a3, $f24
/* B37C 8002FF7C 0C00A720 */  jal       atan2
/* B380 8002FF80 4600B386 */   mov.s    $f14, $f22
/* B384 8002FF84 4614A102 */  mul.s     $f4, $f20, $f20
/* B388 8002FF88 00000000 */  nop
/* B38C 8002FF8C 4618C082 */  mul.s     $f2, $f24, $f24
/* B390 8002FF90 00000000 */  nop
/* B394 8002FF94 46022300 */  add.s     $f12, $f4, $f2
/* B398 8002FF98 46000007 */  neg.s     $f0, $f0
/* B39C 8002FF9C E6000090 */  swc1      $f0, 0x90($s0)
/* B3A0 8002FFA0 46006004 */  sqrt.s    $f0, $f12
/* B3A4 8002FFA4 46000032 */  c.eq.s    $f0, $f0
/* B3A8 8002FFA8 00000000 */  nop
/* B3AC 8002FFAC 45030004 */  bc1tl     .L8002FFC0
/* B3B0 8002FFB0 4600B306 */   mov.s    $f12, $f22
/* B3B4 8002FFB4 0C0187BC */  jal       sqrtf
/* B3B8 8002FFB8 00000000 */   nop
/* B3BC 8002FFBC 4600B306 */  mov.s     $f12, $f22
.L8002FFC0:
/* B3C0 8002FFC0 46000007 */  neg.s     $f0, $f0
/* B3C4 8002FFC4 4406F000 */  mfc1      $a2, $f30
/* B3C8 8002FFC8 44070000 */  mfc1      $a3, $f0
/* B3CC 8002FFCC 0C00A720 */  jal       atan2
/* B3D0 8002FFD0 46006386 */   mov.s    $f14, $f12
/* B3D4 8002FFD4 E6000094 */  swc1      $f0, 0x94($s0)
/* B3D8 8002FFD8 8FBF0014 */  lw        $ra, 0x14($sp)
/* B3DC 8002FFDC 8FB00010 */  lw        $s0, 0x10($sp)
/* B3E0 8002FFE0 D7BE0040 */  ldc1      $f30, 0x40($sp)
/* B3E4 8002FFE4 D7BC0038 */  ldc1      $f28, 0x38($sp)
/* B3E8 8002FFE8 D7BA0030 */  ldc1      $f26, 0x30($sp)
/* B3EC 8002FFEC D7B80028 */  ldc1      $f24, 0x28($sp)
/* B3F0 8002FFF0 D7B60020 */  ldc1      $f22, 0x20($sp)
/* B3F4 8002FFF4 D7B40018 */  ldc1      $f20, 0x18($sp)
/* B3F8 8002FFF8 03E00008 */  jr        $ra
/* B3FC 8002FFFC 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void update_camera_mode_unused(Camera* camera) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 sinBoom;
    f32 cosBoom;
    f32 deltaX;
    f32 deltaY;
    f32 deltaZ;
    f32 deltaX2;
    f32 deltaY2;
    f32 deltaZ2;
    f32 boomYaw;

    if (camera->needsInit || camera->isChangingMap) {
        camera->needsInit = FALSE;
        camera->isChangingMap = FALSE;
        camera->auxPitch = 0;
        camera->auxBoomLength = 100;
        camera->lookAt_dist = 100;
        camera->auxBoomPitch = 0;
        camera->auxBoomYaw = 0;
        camera->lookAt_obj.x = camera->lookAt_obj_target.x;
        camera->lookAt_obj.y = camera->lookAt_obj_target.y;
        camera->lookAt_obj.z = camera->lookAt_obj_target.z;
    }

    if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
        camera->lookAt_obj_target.y = playerStatus->position.y + 60.0f;
    }
    camera->lookAt_obj_target.x = playerStatus->position.x;
    camera->lookAt_obj_target.z = playerStatus->position.z + 400.0f;

    if (camera->auxPitch == 0) {
        camera->lookAt_obj.x = camera->lookAt_obj_target.x;
        camera->lookAt_obj.y = camera->lookAt_obj_target.y;
        camera->lookAt_obj.z = camera->lookAt_obj_target.z;
        camera->trueRotation.x = camera->auxBoomYaw;
        camera->currentBoomYaw = camera->auxBoomPitch;
        camera->currentBoomLength = camera->auxBoomLength;
        camera->vfov = (10000 / camera->lookAt_dist) / 4;
        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;
        deltaX = deltaX2;
        deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom;
        deltaZ = sinBoom * boomYaw + deltaZ2 * cosBoom;
        boomYaw = DEG_TO_RAD(camera->trueRotation.x);
        sinBoom = sin_rad(boomYaw);
        cosBoom = cos_rad(boomYaw);
        deltaZ2 = cosBoom * deltaX - deltaZ * sinBoom;
        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:

glabel __osViSwapContext
/* 42470 80067070 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 42474 80067074 AFB00010 */  sw        $s0, 0x10($sp)
/* 42478 80067078 3C108009 */  lui       $s0, %hi(D_800959D4)
/* 4247C 8006707C 8E1059D4 */  lw        $s0, %lo(D_800959D4)($s0)
/* 42480 80067080 3C02A440 */  lui       $v0, (0xA4400010 >> 16)
/* 42484 80067084 34420010 */  ori       $v0, $v0, (0xA4400010 & 0xFFFF)
/* 42488 80067088 AFBF0024 */  sw        $ra, 0x24($sp)
/* 4248C 8006708C AFB40020 */  sw        $s4, 0x20($sp)
/* 42490 80067090 AFB3001C */  sw        $s3, 0x1C($sp)
/* 42494 80067094 AFB20018 */  sw        $s2, 0x18($sp)
/* 42498 80067098 AFB10014 */  sw        $s1, 0x14($sp)
/* 4249C 8006709C 8C420000 */  lw        $v0, 0x0($v0)
/* 424A0 800670A0 8E040004 */  lw        $a0, 0x4($s0)
/* 424A4 800670A4 8E120008 */  lw        $s2, 0x8($s0)
/* 424A8 800670A8 0C0187A4 */  jal       osVirtualToPhysical
/* 424AC 800670AC 30510001 */   andi     $s1, $v0, 0x1
/* 424B0 800670B0 00111880 */  sll       $v1, $s1, 2
/* 424B4 800670B4 00711821 */  addu      $v1, $v1, $s1
/* 424B8 800670B8 00031880 */  sll       $v1, $v1, 2
/* 424BC 800670BC 02431821 */  addu      $v1, $s2, $v1
/* 424C0 800670C0 8C640028 */  lw        $a0, 0x28($v1)
/* 424C4 800670C4 96030000 */  lhu       $v1, 0x0($s0)
/* 424C8 800670C8 30630002 */  andi      $v1, $v1, 0x2
/* 424CC 800670CC 10600008 */  beqz      $v1, .L800670F0
/* 424D0 800670D0 00443021 */   addu     $a2, $v0, $a0
/* 424D4 800670D4 8E420020 */  lw        $v0, 0x20($s2)
/* 424D8 800670D8 8E030020 */  lw        $v1, 0x20($s0)
/* 424DC 800670DC 2404F000 */  addiu     $a0, $zero, -0x1000
/* 424E0 800670E0 00441024 */  and       $v0, $v0, $a0
/* 424E4 800670E4 00621825 */  or        $v1, $v1, $v0
/* 424E8 800670E8 08019C3E */  j         .L800670F8
/* 424EC 800670EC AE030020 */   sw       $v1, 0x20($s0)
.L800670F0:
/* 424F0 800670F0 8E420020 */  lw        $v0, 0x20($s2)
/* 424F4 800670F4 AE020020 */  sw        $v0, 0x20($s0)
.L800670F8:
/* 424F8 800670F8 96020000 */  lhu       $v0, 0x0($s0)
/* 424FC 800670FC 30420004 */  andi      $v0, $v0, 0x4
/* 42500 80067100 1040002B */  beqz      $v0, .L800671B0
/* 42504 80067104 00111080 */   sll      $v0, $s1, 2
/* 42508 80067108 00511021 */  addu      $v0, $v0, $s1
/* 4250C 8006710C 00021080 */  sll       $v0, $v0, 2
/* 42510 80067110 02421021 */  addu      $v0, $s2, $v0
/* 42514 80067114 8C42002C */  lw        $v0, 0x2C($v0)
/* 42518 80067118 30420FFF */  andi      $v0, $v0, 0xFFF
/* 4251C 8006711C 44822000 */  mtc1      $v0, $f4
/* 42520 80067120 00000000 */  nop
/* 42524 80067124 04410004 */  bgez      $v0, .L80067138
/* 42528 80067128 46802121 */   cvt.d.w  $f4, $f4
/* 4252C 8006712C 3C01800A */  lui       $at, %hi(D_80099D70)
/* 42530 80067130 D4209D70 */  ldc1      $f0, %lo(D_80099D70)($at)
/* 42534 80067134 46202100 */  add.d     $f4, $f4, $f0
.L80067138:
/* 42538 80067138 C6020024 */  lwc1      $f2, 0x24($s0)
/* 4253C 8006713C 46202020 */  cvt.s.d   $f0, $f4
/* 42540 80067140 46001082 */  mul.s     $f2, $f2, $f0
/* 42544 80067144 3C014F00 */  lui       $at, (0x4F000000 >> 16)
/* 42548 80067148 44810000 */  mtc1      $at, $f0
/* 4254C 8006714C 00000000 */  nop
/* 42550 80067150 4602003E */  c.le.s    $f0, $f2
/* 42554 80067154 00000000 */  nop
/* 42558 80067158 00000000 */  nop
/* 4255C 8006715C 45030006 */  bc1tl     .L80067178
/* 42560 80067160 46001001 */   sub.s    $f0, $f2, $f0
/* 42564 80067164 4600100D */  trunc.w.s $f0, $f2
/* 42568 80067168 44040000 */  mfc1      $a0, $f0
/* 4256C 8006716C 00000000 */  nop
/* 42570 80067170 08019C63 */  j         .L8006718C
/* 42574 80067174 00111080 */   sll      $v0, $s1, 2
.L80067178:
/* 42578 80067178 4600008D */  trunc.w.s $f2, $f0
/* 4257C 8006717C 44041000 */  mfc1      $a0, $f2
/* 42580 80067180 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 42584 80067184 00822025 */  or        $a0, $a0, $v0
/* 42588 80067188 00111080 */  sll       $v0, $s1, 2
.L8006718C:
/* 4258C 8006718C 00511021 */  addu      $v0, $v0, $s1
/* 42590 80067190 00021080 */  sll       $v0, $v0, 2
/* 42594 80067194 02421021 */  addu      $v0, $s2, $v0
/* 42598 80067198 AE04002C */  sw        $a0, 0x2C($s0)
/* 4259C 8006719C 8C42002C */  lw        $v0, 0x2C($v0)
/* 425A0 800671A0 2403F000 */  addiu     $v1, $zero, -0x1000
/* 425A4 800671A4 00431024 */  and       $v0, $v0, $v1
/* 425A8 800671A8 08019C70 */  j         .L800671C0
/* 425AC 800671AC 00821025 */   or       $v0, $a0, $v0
.L800671B0:
/* 425B0 800671B0 00511021 */  addu      $v0, $v0, $s1
/* 425B4 800671B4 00021080 */  sll       $v0, $v0, 2
/* 425B8 800671B8 02421021 */  addu      $v0, $s2, $v0
/* 425BC 800671BC 8C42002C */  lw        $v0, 0x2C($v0)
.L800671C0:
/* 425C0 800671C0 AE02002C */  sw        $v0, 0x2C($s0)
/* 425C4 800671C4 8E53001C */  lw        $s3, 0x1C($s2)
/* 425C8 800671C8 00111080 */  sll       $v0, $s1, 2
/* 425CC 800671CC 00511021 */  addu      $v0, $v0, $s1
/* 425D0 800671D0 00021080 */  sll       $v0, $v0, 2
/* 425D4 800671D4 02428821 */  addu      $s1, $s2, $v0
/* 425D8 800671D8 96040000 */  lhu       $a0, 0x0($s0)
/* 425DC 800671DC 3C058009 */  lui       $a1, %hi(D_8009469C)
/* 425E0 800671E0 8CA5469C */  lw        $a1, %lo(D_8009469C)($a1)
/* 425E4 800671E4 8E230030 */  lw        $v1, 0x30($s1)
/* 425E8 800671E8 30820020 */  andi      $v0, $a0, 0x20
/* 425EC 800671EC 2C420001 */  sltiu     $v0, $v0, 0x1
/* 425F0 800671F0 00021023 */  negu      $v0, $v0
/* 425F4 800671F4 02629824 */  and       $s3, $s3, $v0
/* 425F8 800671F8 00051400 */  sll       $v0, $a1, 16
/* 425FC 800671FC 00621823 */  subu      $v1, $v1, $v0
/* 42600 80067200 30840040 */  andi      $a0, $a0, 0x40
/* 42604 80067204 10800005 */  beqz      $a0, .L8006721C
/* 42608 80067208 0065A021 */   addu     $s4, $v1, $a1
/* 4260C 8006720C 8E040004 */  lw        $a0, 0x4($s0)
/* 42610 80067210 0C0187A4 */  jal       osVirtualToPhysical
/* 42614 80067214 AE00002C */   sw       $zero, 0x2C($s0)
/* 42618 80067218 00403021 */  addu      $a2, $v0, $zero
.L8006721C:
/* 4261C 8006721C 96020000 */  lhu       $v0, 0x0($s0)
/* 42620 80067220 30420080 */  andi      $v0, $v0, 0x80
/* 42624 80067224 10400008 */  beqz      $v0, .L80067248
/* 42628 80067228 3C0303FF */   lui      $v1, (0x3FF0000 >> 16)
/* 4262C 8006722C 96020028 */  lhu       $v0, 0x28($s0)
/* 42630 80067230 8E040004 */  lw        $a0, 0x4($s0)
/* 42634 80067234 00021400 */  sll       $v0, $v0, 16
/* 42638 80067238 00431024 */  and       $v0, $v0, $v1
/* 4263C 8006723C 0C0187A4 */  jal       osVirtualToPhysical
/* 42640 80067240 AE02002C */   sw       $v0, 0x2C($s0)
/* 42644 80067244 00403021 */  addu      $a2, $v0, $zero
.L80067248:
/* 42648 80067248 3C02A440 */  lui       $v0, (0xA4400004 >> 16)
/* 4264C 8006724C 34420004 */  ori       $v0, $v0, (0xA4400004 & 0xFFFF)
/* 42650 80067250 3C03A440 */  lui       $v1, (0xA4400008 >> 16)
/* 42654 80067254 34630008 */  ori       $v1, $v1, (0xA4400008 & 0xFFFF)
/* 42658 80067258 3C04A440 */  lui       $a0, (0xA4400014 >> 16)
/* 4265C 8006725C 34840014 */  ori       $a0, $a0, (0xA4400014 & 0xFFFF)
/* 42660 80067260 AC460000 */  sw        $a2, 0x0($v0)
/* 42664 80067264 8E420008 */  lw        $v0, 0x8($s2)
/* 42668 80067268 3C05A440 */  lui       $a1, (0xA4400018 >> 16)
/* 4266C 8006726C 34A50018 */  ori       $a1, $a1, (0xA4400018 & 0xFFFF)
/* 42670 80067270 AC620000 */  sw        $v0, 0x0($v1)
/* 42674 80067274 8E42000C */  lw        $v0, 0xC($s2)
/* 42678 80067278 3C06A440 */  lui       $a2, (0xA4400020 >> 16)
/* 4267C 8006727C 34C60020 */  ori       $a2, $a2, (0xA4400020 & 0xFFFF)
/* 42680 80067280 AC820000 */  sw        $v0, 0x0($a0)
/* 42684 80067284 8E420010 */  lw        $v0, 0x10($s2)
/* 42688 80067288 3C03A440 */  lui       $v1, (0xA440001C >> 16)
/* 4268C 8006728C 3463001C */  ori       $v1, $v1, (0xA440001C & 0xFFFF)
/* 42690 80067290 ACA20000 */  sw        $v0, 0x0($a1)
/* 42694 80067294 8E420014 */  lw        $v0, 0x14($s2)
/* 42698 80067298 3C04A440 */  lui       $a0, (0xA4400024 >> 16)
/* 4269C 8006729C 34840024 */  ori       $a0, $a0, (0xA4400024 & 0xFFFF)
/* 426A0 800672A0 AC620000 */  sw        $v0, 0x0($v1)
/* 426A4 800672A4 8E420018 */  lw        $v0, 0x18($s2)
/* 426A8 800672A8 3C03A440 */  lui       $v1, (0xA4400028 >> 16)
/* 426AC 800672AC 34630028 */  ori       $v1, $v1, (0xA4400028 & 0xFFFF)
/* 426B0 800672B0 ACC20000 */  sw        $v0, 0x0($a2)
/* 426B4 800672B4 AC930000 */  sw        $s3, 0x0($a0)
/* 426B8 800672B8 AC740000 */  sw        $s4, 0x0($v1)
/* 426BC 800672BC 8E230034 */  lw        $v1, 0x34($s1)
/* 426C0 800672C0 3C02A440 */  lui       $v0, (0xA440002C >> 16)
/* 426C4 800672C4 3442002C */  ori       $v0, $v0, (0xA440002C & 0xFFFF)
/* 426C8 800672C8 AC430000 */  sw        $v1, 0x0($v0)
/* 426CC 800672CC 8E230038 */  lw        $v1, 0x38($s1)
/* 426D0 800672D0 3C02A440 */  lui       $v0, (0xA440000C >> 16)
/* 426D4 800672D4 3442000C */  ori       $v0, $v0, (0xA440000C & 0xFFFF)
/* 426D8 800672D8 AC430000 */  sw        $v1, 0x0($v0)
/* 426DC 800672DC 8E030020 */  lw        $v1, 0x20($s0)
/* 426E0 800672E0 3C02A440 */  lui       $v0, (0xA4400030 >> 16)
/* 426E4 800672E4 34420030 */  ori       $v0, $v0, (0xA4400030 & 0xFFFF)
/* 426E8 800672E8 AC430000 */  sw        $v1, 0x0($v0)
/* 426EC 800672EC 8E03002C */  lw        $v1, 0x2C($s0)
/* 426F0 800672F0 3C02A440 */  lui       $v0, (0xA4400034 >> 16)
/* 426F4 800672F4 34420034 */  ori       $v0, $v0, (0xA4400034 & 0xFFFF)
/* 426F8 800672F8 AC430000 */  sw        $v1, 0x0($v0)
/* 426FC 800672FC 8E03000C */  lw        $v1, 0xC($s0)
/* 42700 80067300 3C028009 */  lui       $v0, %hi(D_800959D0)
/* 42704 80067304 8C4259D0 */  lw        $v0, %lo(D_800959D0)($v0)
/* 42708 80067308 02003021 */  addu      $a2, $s0, $zero
/* 4270C 8006730C 24C80030 */  addiu     $t0, $a2, 0x30
/* 42710 80067310 3C018009 */  lui       $at, %hi(D_800959D0)
/* 42714 80067314 AC2659D0 */  sw        $a2, %lo(D_800959D0)($at)
/* 42718 80067318 00403821 */  addu      $a3, $v0, $zero
/* 4271C 8006731C 3C02A440 */  lui       $v0, %hi(D_A4400000)
/* 42720 80067320 3C018009 */  lui       $at, %hi(D_800959D4)
/* 42724 80067324 AC2759D4 */  sw        $a3, %lo(D_800959D4)($at)
/* 42728 80067328 AC430000 */  sw        $v1, %lo(D_A4400000)($v0)
.L8006732C:
/* 4272C 8006732C 8CC20000 */  lw        $v0, 0x0($a2)
/* 42730 80067330 8CC30004 */  lw        $v1, 0x4($a2)
/* 42734 80067334 8CC40008 */  lw        $a0, 0x8($a2)
/* 42738 80067338 8CC5000C */  lw        $a1, 0xC($a2)
/* 4273C 8006733C ACE20000 */  sw        $v0, 0x0($a3)
/* 42740 80067340 ACE30004 */  sw        $v1, 0x4($a3)
/* 42744 80067344 ACE40008 */  sw        $a0, 0x8($a3)
/* 42748 80067348 ACE5000C */  sw        $a1, 0xC($a3)
/* 4274C 8006734C 24C60010 */  addiu     $a2, $a2, 0x10
/* 42750 80067350 14C8FFF6 */  bne       $a2, $t0, .L8006732C
/* 42754 80067354 24E70010 */   addiu    $a3, $a3, 0x10
/* 42758 80067358 8FBF0024 */  lw        $ra, 0x24($sp)
/* 4275C 8006735C 8FB40020 */  lw        $s4, 0x20($sp)
/* 42760 80067360 8FB3001C */  lw        $s3, 0x1C($sp)
/* 42764 80067364 8FB20018 */  lw        $s2, 0x18($sp)
/* 42768 80067368 8FB10014 */  lw        $s1, 0x14($sp)
/* 4276C 8006736C 8FB00010 */  lw        $s0, 0x10($sp)
/* 42770 80067370 03E00008 */  jr        $ra
/* 42774 80067374 27BD0028 */   addiu    $sp, $sp, 0x28
/* 42778 80067378 00000000 */  nop
/* 4277C 8006737C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void __osViSwapContext() {
    register OSViMode *vm;
    register __OSViContext *vc;
    u32 origin;
    u32 vStart;
    u32 hStart;
    u32 nomValue;
    u32 field;

    field = 0;
    vc = __osViNext;
    vm = vc->modep;

    field = IO_READ(VI_CURRENT_REG) & 1; //field num

    origin = osVirtualToPhysical(vc->framep) + (vm->fldRegs[field].origin);
    if (vc->state & VI_STATE_XSCALE_UPDATED) {
        vc->x.scale |= (vm->comRegs.xScale & ~VI_SCALE_MASK);
    } else {
        vc->x.scale = vm->comRegs.xScale;
    }

    if (vc->state & VI_STATE_YSCALE_UPDATED) {
        nomValue = vm->fldRegs[field].yScale & VI_SCALE_MASK;
        vc->y.scale = vc->y.factor * nomValue;
        vc->y.scale |= vm->fldRegs[field].yScale & ~VI_SCALE_MASK;
    } else {
        vc->y.scale = vm->fldRegs[field].yScale;
    }

    vStart = (vm->fldRegs[field].vStart - (__additional_scanline << 0x10)) + __additional_scanline;
    hStart = vm->comRegs.hStart;

    if (vc->state & VI_STATE_BLACK) {
        hStart = 0;
    }

    if (vc->state & VI_STATE_REPEATLINE) {
        vc->y.scale = 0;
        origin = osVirtualToPhysical(vc->framep);
    }

    if (vc->state & VI_STATE_FADE) {
        vc->y.scale = (vc->y.offset << VI_SUBPIXEL_SH) & (VI_2_10_FPART_MASK << VI_SUBPIXEL_SH);
        origin = osVirtualToPhysical(vc->framep);
    }

    IO_WRITE(VI_ORIGIN_REG, origin);
    IO_WRITE(VI_WIDTH_REG, vm->comRegs.width);
    IO_WRITE(VI_BURST_REG, vm->comRegs.burst);
    IO_WRITE(VI_V_SYNC_REG, vm->comRegs.vSync);
    IO_WRITE(VI_H_SYNC_REG, vm->comRegs.hSync);
    IO_WRITE(VI_LEAP_REG, vm->comRegs.leap);
    IO_WRITE(VI_H_START_REG, hStart);
    IO_WRITE(VI_V_START_REG, vStart);
    IO_WRITE(VI_V_BURST_REG, vm->fldRegs[field].vBurst);
    IO_WRITE(VI_INTR_REG, vm->fldRegs[field].vIntr);
    IO_WRITE(VI_X_SCALE_REG, vc->x.scale);
    IO_WRITE(VI_Y_SCALE_REG, vc->y.scale);
    IO_WRITE(VI_CONTROL_REG, vc->control);

    __osViNext = __osViCurr;
    __osViCurr = vc;
    *__osViNext = *__osViCurr;
}