### RAW ASSEMBLY INSTRUCTIONS:

glabel FinishPushBlockMotion
/* 7E3AC0 80282C40 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 7E3AC4 80282C44 AFB30034 */  sw        $s3, 0x34($sp)
/* 7E3AC8 80282C48 0080982D */  daddu     $s3, $a0, $zero
/* 7E3ACC 80282C4C AFB00028 */  sw        $s0, 0x28($sp)
/* 7E3AD0 80282C50 AFBF0038 */  sw        $ra, 0x38($sp)
/* 7E3AD4 80282C54 AFB20030 */  sw        $s2, 0x30($sp)
/* 7E3AD8 80282C58 AFB1002C */  sw        $s1, 0x2C($sp)
/* 7E3ADC 80282C5C 8E6400B0 */  lw        $a0, 0xB0($s3)
/* 7E3AE0 80282C60 8E7200AC */  lw        $s2, 0xAC($s3)
/* 7E3AE4 80282C64 0C04417A */  jal       get_entity_by_index
/* 7E3AE8 80282C68 00A0802D */   daddu    $s0, $a1, $zero
/* 7E3AEC 80282C6C 12000023 */  beqz      $s0, .L80282CFC
/* 7E3AF0 80282C70 0040882D */   daddu    $s1, $v0, $zero
/* 7E3AF4 80282C74 0000202D */  daddu     $a0, $zero, $zero
/* 7E3AF8 80282C78 27A50018 */  addiu     $a1, $sp, 0x18
/* 7E3AFC 80282C7C 27A20024 */  addiu     $v0, $sp, 0x24
/* 7E3B00 80282C80 27A6001C */  addiu     $a2, $sp, 0x1C
/* 7E3B04 80282C84 27A70020 */  addiu     $a3, $sp, 0x20
/* 7E3B08 80282C88 AE600070 */  sw        $zero, 0x70($s3)
/* 7E3B0C 80282C8C C620004C */  lwc1      $f0, 0x4C($s1)
/* 7E3B10 80282C90 3C01420C */  lui       $at, (0x420C0000 >> 16)
/* 7E3B14 80282C94 44811000 */  mtc1      $at, $f2
/* 7E3B18 80282C98 4600020D */  trunc.w.s $f8, $f0
/* 7E3B1C 80282C9C E6680084 */  swc1      $f8, 0x84($s3)
/* 7E3B20 80282CA0 E7A20024 */  swc1      $f2, 0x24($sp)
/* 7E3B24 80282CA4 C6260048 */  lwc1      $f6, 0x48($s1)
/* 7E3B28 80282CA8 C620004C */  lwc1      $f0, 0x4C($s1)
/* 7E3B2C 80282CAC 3C0140A0 */  lui       $at, (0x40A00000 >> 16)
/* 7E3B30 80282CB0 44811000 */  mtc1      $at, $f2
/* 7E3B34 80282CB4 C6240050 */  lwc1      $f4, 0x50($s1)
/* 7E3B38 80282CB8 46020000 */  add.s     $f0, $f0, $f2
/* 7E3B3C 80282CBC E7A60018 */  swc1      $f6, 0x18($sp)
/* 7E3B40 80282CC0 E7A40020 */  swc1      $f4, 0x20($sp)
/* 7E3B44 80282CC4 E7A0001C */  swc1      $f0, 0x1C($sp)
/* 7E3B48 80282CC8 0C0372DF */  jal       npc_raycast_down_sides
/* 7E3B4C 80282CCC AFA20010 */   sw       $v0, 0x10($sp)
/* 7E3B50 80282CD0 C7A20024 */  lwc1      $f2, 0x24($sp)
/* 7E3B54 80282CD4 4600120D */  trunc.w.s $f8, $f2
/* 7E3B58 80282CD8 10400008 */  beqz      $v0, .L80282CFC
/* 7E3B5C 80282CDC E6680074 */   swc1     $f8, 0x74($s3)
/* 7E3B60 80282CE0 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* 7E3B64 80282CE4 44810000 */  mtc1      $at, $f0
/* 7E3B68 80282CE8 00000000 */  nop
/* 7E3B6C 80282CEC 4600103E */  c.le.s    $f2, $f0
/* 7E3B70 80282CF0 00000000 */  nop
/* 7E3B74 80282CF4 45010047 */  bc1t      .L80282E14
/* 7E3B78 80282CF8 24020002 */   addiu    $v0, $zero, 0x2
.L80282CFC:
/* 7E3B7C 80282CFC 8E420014 */  lw        $v0, 0x14($s2)
/* 7E3B80 80282D00 10400019 */  beqz      $v0, .L80282D68
/* 7E3B84 80282D04 0220202D */   daddu    $a0, $s1, $zero
/* 7E3B88 80282D08 0040F809 */  jalr      $v0
/* 7E3B8C 80282D0C 0260282D */   daddu    $a1, $s3, $zero
/* 7E3B90 80282D10 10400040 */  beqz      $v0, .L80282E14
/* 7E3B94 80282D14 0000102D */   daddu    $v0, $zero, $zero
/* 7E3B98 80282D18 C6460008 */  lwc1      $f6, 0x8($s2)
/* 7E3B9C 80282D1C 468031A0 */  cvt.s.w   $f6, $f6
/* 7E3BA0 80282D20 C6400010 */  lwc1      $f0, 0x10($s2)
/* 7E3BA4 80282D24 46800020 */  cvt.s.w   $f0, $f0
/* 7E3BA8 80282D28 C6220050 */  lwc1      $f2, 0x50($s1)
/* 7E3BAC 80282D2C 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 7E3BB0 80282D30 44812000 */  mtc1      $at, $f4
/* 7E3BB4 80282D34 46001081 */  sub.s     $f2, $f2, $f0
/* 7E3BB8 80282D38 C6200048 */  lwc1      $f0, 0x48($s1)
/* 7E3BBC 80282D3C 92420004 */  lbu       $v0, 0x4($s2)
/* 7E3BC0 80282D40 46060001 */  sub.s     $f0, $f0, $f6
/* 7E3BC4 80282D44 46041083 */  div.s     $f2, $f2, $f4
/* 7E3BC8 80282D48 4600120D */  trunc.w.s $f8, $f2
/* 7E3BCC 80282D4C 44034000 */  mfc1      $v1, $f8
/* 7E3BD0 80282D50 00000000 */  nop
/* 7E3BD4 80282D54 00620018 */  mult      $v1, $v0
/* 7E3BD8 80282D58 24020001 */  addiu     $v0, $zero, 0x1
/* 7E3BDC 80282D5C 8E430000 */  lw        $v1, 0x0($s2)
/* 7E3BE0 80282D60 080A0B7D */  j         .L80282DF4
/* 7E3BE4 80282D64 46040003 */   div.s    $f0, $f0, $f4
.L80282D68:
/* 7E3BE8 80282D68 8E620070 */  lw        $v0, 0x70($s3)
/* 7E3BEC 80282D6C 3C0141C8 */  lui       $at, (0x41C80000 >> 16)
/* 7E3BF0 80282D70 44813000 */  mtc1      $at, $f6
/* 7E3BF4 80282D74 00021080 */  sll       $v0, $v0, 2
/* 7E3BF8 80282D78 3C018028 */  lui       $at, %hi(D_80285640)
/* 7E3BFC 80282D7C 00220821 */  addu      $at, $at, $v0
/* 7E3C00 80282D80 C4225640 */  lwc1      $f2, %lo(D_80285640)($at)
/* 7E3C04 80282D84 46061082 */  mul.s     $f2, $f2, $f6
/* 7E3C08 80282D88 00000000 */  nop
/* 7E3C0C 80282D8C C6600084 */  lwc1      $f0, 0x84($s3)
/* 7E3C10 80282D90 46800020 */  cvt.s.w   $f0, $f0
/* 7E3C14 80282D94 46020001 */  sub.s     $f0, $f0, $f2
/* 7E3C18 80282D98 E620004C */  swc1      $f0, 0x4C($s1)
/* 7E3C1C 80282D9C 8E620070 */  lw        $v0, 0x70($s3)
/* 7E3C20 80282DA0 2403000D */  addiu     $v1, $zero, 0xD
/* 7E3C24 80282DA4 24420001 */  addiu     $v0, $v0, 0x1
/* 7E3C28 80282DA8 14430019 */  bne       $v0, $v1, .L80282E10
/* 7E3C2C 80282DAC AE620070 */   sw       $v0, 0x70($s3)
/* 7E3C30 80282DB0 C6400010 */  lwc1      $f0, 0x10($s2)
/* 7E3C34 80282DB4 46800020 */  cvt.s.w   $f0, $f0
/* 7E3C38 80282DB8 C6220050 */  lwc1      $f2, 0x50($s1)
/* 7E3C3C 80282DBC C6440008 */  lwc1      $f4, 0x8($s2)
/* 7E3C40 80282DC0 46802120 */  cvt.s.w   $f4, $f4
/* 7E3C44 80282DC4 46001081 */  sub.s     $f2, $f2, $f0
/* 7E3C48 80282DC8 C6200048 */  lwc1      $f0, 0x48($s1)
/* 7E3C4C 80282DCC 92420004 */  lbu       $v0, 0x4($s2)
/* 7E3C50 80282DD0 46040001 */  sub.s     $f0, $f0, $f4
/* 7E3C54 80282DD4 46061083 */  div.s     $f2, $f2, $f6
/* 7E3C58 80282DD8 4600120D */  trunc.w.s $f8, $f2
/* 7E3C5C 80282DDC 44034000 */  mfc1      $v1, $f8
/* 7E3C60 80282DE0 00000000 */  nop
/* 7E3C64 80282DE4 00620018 */  mult      $v1, $v0
/* 7E3C68 80282DE8 24020001 */  addiu     $v0, $zero, 0x1
/* 7E3C6C 80282DEC 8E430000 */  lw        $v1, 0x0($s2)
/* 7E3C70 80282DF0 46060003 */  div.s     $f0, $f0, $f6
.L80282DF4:
/* 7E3C74 80282DF4 4600020D */  trunc.w.s $f8, $f0
/* 7E3C78 80282DF8 44044000 */  mfc1      $a0, $f8
/* 7E3C7C 80282DFC 00004012 */  mflo      $t0
/* 7E3C80 80282E00 00882021 */  addu      $a0, $a0, $t0
/* 7E3C84 80282E04 00641821 */  addu      $v1, $v1, $a0
/* 7E3C88 80282E08 080A0B85 */  j         .L80282E14
/* 7E3C8C 80282E0C A0600000 */   sb       $zero, 0x0($v1)
.L80282E10:
/* 7E3C90 80282E10 0000102D */  daddu     $v0, $zero, $zero
.L80282E14:
/* 7E3C94 80282E14 8FBF0038 */  lw        $ra, 0x38($sp)
/* 7E3C98 80282E18 8FB30034 */  lw        $s3, 0x34($sp)
/* 7E3C9C 80282E1C 8FB20030 */  lw        $s2, 0x30($sp)
/* 7E3CA0 80282E20 8FB1002C */  lw        $s1, 0x2C($sp)
/* 7E3CA4 80282E24 8FB00028 */  lw        $s0, 0x28($sp)
/* 7E3CA8 80282E28 03E00008 */  jr        $ra
/* 7E3CAC 80282E2C 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

API_CALLABLE(FinishPushBlockMotion) {
    PushBlockGrid* grid = script->varTablePtr[10];
    Entity* block = get_entity_by_index(script->varTable[11]);
    f32 hitX, hitY, hitZ, hitDepth;
    s32 hitResult;
    s32 i, j;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
        script->varTable[0] = block->position.y;

        hitX = block->position.x;
        hitZ = block->position.z;
        hitY = block->position.y + 5.0f;

        hitDepth = 35.0f;
        hitResult = npc_raycast_down_sides(0, &hitX, &hitY, &hitZ, &hitDepth);
        script->functionTemp[1] = hitDepth;

        if (hitResult != 0 && hitDepth <= 6.0f) {
            return ApiStatus_DONE2;
        }
    }

    if (grid->dropCallback != NULL) {
        if (grid->dropCallback(block, script)) {
            i = (block->position.x - grid->centerPos.x) / BLOCK_GRID_SIZE;
            j = (block->position.z - grid->centerPos.z) / BLOCK_GRID_SIZE;
            grid->cells[i + (j * grid->numCellsX)] = 0;
            return ApiStatus_DONE1;
        } else {
            return ApiStatus_BLOCK;
        }
    } else {
        block->position.y = script->varTable[0] - (PushBlockMovePositions[script->functionTemp[0]] * BLOCK_GRID_SIZE);
        script->functionTemp[0]++;
        if (script->functionTemp[0] != ARRAY_COUNT(PushBlockMovePositions)) {
            return ApiStatus_BLOCK;
        }
        i = (block->position.x - grid->centerPos.x) / BLOCK_GRID_SIZE;
        j = (block->position.z - grid->centerPos.z) / BLOCK_GRID_SIZE;
        grid->cells[i + (j * grid->numCellsX)] = PUSH_GRID_EMPTY;
    }
    return ApiStatus_DONE1;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel gfx_transfer_frame_to_depth
/* 2DB4 800279B4 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 2DB8 800279B8 AFB50054 */  sw        $s5, 0x54($sp)
/* 2DBC 800279BC 0080A82D */  daddu     $s5, $a0, $zero
/* 2DC0 800279C0 AFB60058 */  sw        $s6, 0x58($sp)
/* 2DC4 800279C4 00A0B02D */  daddu     $s6, $a1, $zero
/* 2DC8 800279C8 AFB3004C */  sw        $s3, 0x4C($sp)
/* 2DCC 800279CC 24130001 */  addiu     $s3, $zero, 0x1
/* 2DD0 800279D0 27A80018 */  addiu     $t0, $sp, 0x18
/* 2DD4 800279D4 AFA80038 */  sw        $t0, 0x38($sp)
/* 2DD8 800279D8 24080140 */  addiu     $t0, $zero, 0x140
/* 2DDC 800279DC AFBF0064 */  sw        $ra, 0x64($sp)
/* 2DE0 800279E0 AFBE0060 */  sw        $fp, 0x60($sp)
/* 2DE4 800279E4 AFB7005C */  sw        $s7, 0x5C($sp)
/* 2DE8 800279E8 AFB40050 */  sw        $s4, 0x50($sp)
/* 2DEC 800279EC AFB20048 */  sw        $s2, 0x48($sp)
/* 2DF0 800279F0 AFB10044 */  sw        $s1, 0x44($sp)
/* 2DF4 800279F4 AFB00040 */  sw        $s0, 0x40($sp)
/* 2DF8 800279F8 AFA60070 */  sw        $a2, 0x70($sp)
/* 2DFC 800279FC AFA8003C */  sw        $t0, 0x3C($sp)
.L80027A00:
/* 2E00 80027A00 24120002 */  addiu     $s2, $zero, 0x2
/* 2E04 80027A04 267EFFFF */  addiu     $fp, $s3, -0x1
/* 2E08 80027A08 26770001 */  addiu     $s7, $s3, 0x1
.L80027A0C:
/* 2E0C 80027A0C 8FA8003C */  lw        $t0, 0x3C($sp)
/* 2E10 80027A10 01121021 */  addu      $v0, $t0, $s2
/* 2E14 80027A14 0002A040 */  sll       $s4, $v0, 1
/* 2E18 80027A18 02961021 */  addu      $v0, $s4, $s6
/* 2E1C 80027A1C 94420000 */  lhu       $v0, 0x0($v0)
/* 2E20 80027A20 00021082 */  srl       $v0, $v0, 2
/* 2E24 80027A24 3042000F */  andi      $v0, $v0, 0xF
/* 2E28 80027A28 2C420008 */  sltiu     $v0, $v0, 0x8
/* 2E2C 80027A2C 10400043 */  beqz      $v0, .L80027B3C
/* 2E30 80027A30 02A0202D */   daddu    $a0, $s5, $zero
/* 2E34 80027A34 02C0282D */  daddu     $a1, $s6, $zero
/* 2E38 80027A38 03C0302D */  daddu     $a2, $fp, $zero
/* 2E3C 80027A3C 2650FFFF */  addiu     $s0, $s2, -0x1
/* 2E40 80027A40 8FA80038 */  lw        $t0, 0x38($sp)
/* 2E44 80027A44 0200382D */  daddu     $a3, $s0, $zero
/* 2E48 80027A48 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2E4C 80027A4C AFA80010 */   sw       $t0, 0x10($sp)
/* 2E50 80027A50 02A0202D */  daddu     $a0, $s5, $zero
/* 2E54 80027A54 02C0282D */  daddu     $a1, $s6, $zero
/* 2E58 80027A58 03C0302D */  daddu     $a2, $fp, $zero
/* 2E5C 80027A5C 26510001 */  addiu     $s1, $s2, 0x1
/* 2E60 80027A60 0220382D */  daddu     $a3, $s1, $zero
/* 2E64 80027A64 27A2001C */  addiu     $v0, $sp, 0x1C
/* 2E68 80027A68 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2E6C 80027A6C AFA20010 */   sw       $v0, 0x10($sp)
/* 2E70 80027A70 02A0202D */  daddu     $a0, $s5, $zero
/* 2E74 80027A74 02C0282D */  daddu     $a1, $s6, $zero
/* 2E78 80027A78 0260302D */  daddu     $a2, $s3, $zero
/* 2E7C 80027A7C 2647FFFE */  addiu     $a3, $s2, -0x2
/* 2E80 80027A80 27A20020 */  addiu     $v0, $sp, 0x20
/* 2E84 80027A84 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2E88 80027A88 AFA20010 */   sw       $v0, 0x10($sp)
/* 2E8C 80027A8C 02A0202D */  daddu     $a0, $s5, $zero
/* 2E90 80027A90 02C0282D */  daddu     $a1, $s6, $zero
/* 2E94 80027A94 0260302D */  daddu     $a2, $s3, $zero
/* 2E98 80027A98 26470002 */  addiu     $a3, $s2, 0x2
/* 2E9C 80027A9C 27A20024 */  addiu     $v0, $sp, 0x24
/* 2EA0 80027AA0 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2EA4 80027AA4 AFA20010 */   sw       $v0, 0x10($sp)
/* 2EA8 80027AA8 02A0202D */  daddu     $a0, $s5, $zero
/* 2EAC 80027AAC 02C0282D */  daddu     $a1, $s6, $zero
/* 2EB0 80027AB0 02E0302D */  daddu     $a2, $s7, $zero
/* 2EB4 80027AB4 0200382D */  daddu     $a3, $s0, $zero
/* 2EB8 80027AB8 27A20028 */  addiu     $v0, $sp, 0x28
/* 2EBC 80027ABC 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2EC0 80027AC0 AFA20010 */   sw       $v0, 0x10($sp)
/* 2EC4 80027AC4 02A0202D */  daddu     $a0, $s5, $zero
/* 2EC8 80027AC8 02C0282D */  daddu     $a1, $s6, $zero
/* 2ECC 80027ACC 02E0302D */  daddu     $a2, $s7, $zero
/* 2ED0 80027AD0 0220382D */  daddu     $a3, $s1, $zero
/* 2ED4 80027AD4 27A2002C */  addiu     $v0, $sp, 0x2C
/* 2ED8 80027AD8 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2EDC 80027ADC AFA20010 */   sw       $v0, 0x10($sp)
/* 2EE0 80027AE0 02A0202D */  daddu     $a0, $s5, $zero
/* 2EE4 80027AE4 02C0282D */  daddu     $a1, $s6, $zero
/* 2EE8 80027AE8 0260302D */  daddu     $a2, $s3, $zero
/* 2EEC 80027AEC 0240382D */  daddu     $a3, $s2, $zero
/* 2EF0 80027AF0 27A20030 */  addiu     $v0, $sp, 0x30
/* 2EF4 80027AF4 0C009C7F */  jal       gfx_frame_filter_pass_0
/* 2EF8 80027AF8 AFA20010 */   sw       $v0, 0x10($sp)
/* 2EFC 80027AFC 8FA40038 */  lw        $a0, 0x38($sp)
/* 2F00 80027B00 8FA80070 */  lw        $t0, 0x70($sp)
/* 2F04 80027B04 93A50030 */  lbu       $a1, 0x30($sp)
/* 2F08 80027B08 93A20031 */  lbu       $v0, 0x31($sp)
/* 2F0C 80027B0C 93A30032 */  lbu       $v1, 0x32($sp)
/* 2F10 80027B10 01143021 */  addu      $a2, $t0, $s4
/* 2F14 80027B14 00052E00 */  sll       $a1, $a1, 24
/* 2F18 80027B18 00021400 */  sll       $v0, $v0, 16
/* 2F1C 80027B1C 00A22825 */  or        $a1, $a1, $v0
/* 2F20 80027B20 00031A00 */  sll       $v1, $v1, 8
/* 2F24 80027B24 93A20033 */  lbu       $v0, 0x33($sp)
/* 2F28 80027B28 00A32825 */  or        $a1, $a1, $v1
/* 2F2C 80027B2C 0C009C97 */  jal       gfx_frame_filter_pass_1
/* 2F30 80027B30 00A22825 */   or       $a1, $a1, $v0
/* 2F34 80027B34 08009ED6 */  j         .L80027B58
/* 2F38 80027B38 26520001 */   addiu    $s2, $s2, 0x1
.L80027B3C:
/* 2F3C 80027B3C 02951021 */  addu      $v0, $s4, $s5
/* 2F40 80027B40 8FA80070 */  lw        $t0, 0x70($sp)
/* 2F44 80027B44 94420000 */  lhu       $v0, 0x0($v0)
/* 2F48 80027B48 02881821 */  addu      $v1, $s4, $t0
/* 2F4C 80027B4C 34420001 */  ori       $v0, $v0, 0x1
/* 2F50 80027B50 A4620000 */  sh        $v0, 0x0($v1)
/* 2F54 80027B54 26520001 */  addiu     $s2, $s2, 0x1
.L80027B58:
/* 2F58 80027B58 2A42013E */  slti      $v0, $s2, 0x13E
/* 2F5C 80027B5C 1440FFAB */  bnez      $v0, .L80027A0C
/* 2F60 80027B60 00000000 */   nop
/* 2F64 80027B64 26730001 */  addiu     $s3, $s3, 0x1
/* 2F68 80027B68 8FA8003C */  lw        $t0, 0x3C($sp)
/* 2F6C 80027B6C 2A6200EF */  slti      $v0, $s3, 0xEF
/* 2F70 80027B70 25080140 */  addiu     $t0, $t0, 0x140
/* 2F74 80027B74 1440FFA2 */  bnez      $v0, .L80027A00
/* 2F78 80027B78 AFA8003C */   sw       $t0, 0x3C($sp)
/* 2F7C 80027B7C 8FBF0064 */  lw        $ra, 0x64($sp)
/* 2F80 80027B80 8FBE0060 */  lw        $fp, 0x60($sp)
/* 2F84 80027B84 8FB7005C */  lw        $s7, 0x5C($sp)
/* 2F88 80027B88 8FB60058 */  lw        $s6, 0x58($sp)
/* 2F8C 80027B8C 8FB50054 */  lw        $s5, 0x54($sp)
/* 2F90 80027B90 8FB40050 */  lw        $s4, 0x50($sp)
/* 2F94 80027B94 8FB3004C */  lw        $s3, 0x4C($sp)
/* 2F98 80027B98 8FB20048 */  lw        $s2, 0x48($sp)
/* 2F9C 80027B9C 8FB10044 */  lw        $s1, 0x44($sp)
/* 2FA0 80027BA0 8FB00040 */  lw        $s0, 0x40($sp)
/* 2FA4 80027BA4 03E00008 */  jr        $ra
/* 2FA8 80027BA8 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

void gfx_transfer_frame_to_depth(u16* frameBuffer0, u16* frameBuffer1, u16* zBuffer) {
    Color_RGBA8 filterBuf0[6];
    Color_RGBA8 filterBuf1;
    s32 y;
    s32 x;

    for (y = 1; y < SCREEN_HEIGHT - 1; y++) {
        for (x = 2; x < SCREEN_WIDTH - 2; x++) {
            s32 pixel = SCREEN_WIDTH * y + x;

            /*
            The application of gfx_frame_filter_pass_0 is done to the following pixels, where x is the current pixel.
               . .
              . x .
               . .
            */
            if (((frameBuffer1[pixel] >> 2) & 0xF) < 8) {
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y - 1, x - 1, &filterBuf0[0]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y - 1, x + 1, &filterBuf0[1]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y,     x - 2, &filterBuf0[2]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y,     x + 2, &filterBuf0[3]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y + 1, x - 1, &filterBuf0[4]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y + 1, x + 1, &filterBuf0[5]);
                gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y,     x,     &filterBuf1);
                gfx_frame_filter_pass_1(filterBuf0, filterBuf1, &zBuffer[pixel]);
            } else {
                // Don't apply any filters to the edges of the screen
                zBuffer[pixel] = frameBuffer0[pixel] | 1;
            }
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel explosion_main
/* 343680 E0032000 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 343684 E0032004 F7B40038 */  sdc1      $f20, 0x38($sp)
/* 343688 E0032008 4485A000 */  mtc1      $a1, $f20
/* 34368C E003200C AFB1002C */  sw        $s1, 0x2C($sp)
/* 343690 E0032010 0080882D */  daddu     $s1, $a0, $zero
/* 343694 E0032014 F7B60040 */  sdc1      $f22, 0x40($sp)
/* 343698 E0032018 4486B000 */  mtc1      $a2, $f22
/* 34369C E003201C 27A40010 */  addiu     $a0, $sp, 0x10
/* 3436A0 E0032020 F7B80048 */  sdc1      $f24, 0x48($sp)
/* 3436A4 E0032024 4487C000 */  mtc1      $a3, $f24
/* 3436A8 E0032028 3C02E003 */  lui       $v0, %hi(explosion_init)
/* 3436AC E003202C 244221D0 */  addiu     $v0, $v0, %lo(explosion_init)
/* 3436B0 E0032030 AFBF0030 */  sw        $ra, 0x30($sp)
/* 3436B4 E0032034 AFB00028 */  sw        $s0, 0x28($sp)
/* 3436B8 E0032038 AFA00010 */  sw        $zero, 0x10($sp)
/* 3436BC E003203C AC820008 */  sw        $v0, 0x8($a0)
/* 3436C0 E0032040 3C02E003 */  lui       $v0, %hi(explosion_update)
/* 3436C4 E0032044 244221D8 */  addiu     $v0, $v0, %lo(explosion_update)
/* 3436C8 E0032048 AC82000C */  sw        $v0, 0xC($a0)
/* 3436CC E003204C 3C02E003 */  lui       $v0, %hi(explosion_render)
/* 3436D0 E0032050 24422420 */  addiu     $v0, $v0, %lo(explosion_render)
/* 3436D4 E0032054 AC820010 */  sw        $v0, 0x10($a0)
/* 3436D8 E0032058 24020019 */  addiu     $v0, $zero, 0x19
/* 3436DC E003205C AC800014 */  sw        $zero, 0x14($a0)
/* 3436E0 E0032060 0C080124 */  jal       shim_create_effect_instance
/* 3436E4 E0032064 AC820004 */   sw       $v0, 0x4($a0)
/* 3436E8 E0032068 240400B4 */  addiu     $a0, $zero, 0xB4
/* 3436EC E003206C 24030003 */  addiu     $v1, $zero, 0x3
/* 3436F0 E0032070 0040802D */  daddu     $s0, $v0, $zero
/* 3436F4 E0032074 0C08012C */  jal       shim_general_heap_malloc
/* 3436F8 E0032078 AE030008 */   sw       $v1, 0x8($s0)
/* 3436FC E003207C 0040182D */  daddu     $v1, $v0, $zero
/* 343700 E0032080 14600003 */  bnez      $v1, .LE0032090
/* 343704 E0032084 AE03000C */   sw       $v1, 0xC($s0)
.LE0032088:
/* 343708 E0032088 0800C822 */  j         .LE0032088
/* 34370C E003208C 00000000 */   nop
.LE0032090:
/* 343710 E0032090 2402003C */  addiu     $v0, $zero, 0x3C
/* 343714 E0032094 E4740004 */  swc1      $f20, 0x4($v1)
/* 343718 E0032098 E4760008 */  swc1      $f22, 0x8($v1)
/* 34371C E003209C E478000C */  swc1      $f24, 0xC($v1)
/* 343720 E00320A0 AC600034 */  sw        $zero, 0x34($v1)
/* 343724 E00320A4 AC620030 */  sw        $v0, 0x30($v1)
/* 343728 E00320A8 AC710000 */  sw        $s1, 0x0($v1)
/* 34372C E00320AC 00621821 */  addu      $v1, $v1, $v0
/* 343730 E00320B0 16200003 */  bnez      $s1, .LE00320C0
/* 343734 E00320B4 AC710000 */   sw       $s1, 0x0($v1)
/* 343738 E00320B8 2402FFFF */  addiu     $v0, $zero, -0x1
/* 34373C E00320BC AC620000 */  sw        $v0, 0x0($v1)
.LE00320C0:
/* 343740 E00320C0 24020001 */  addiu     $v0, $zero, 0x1
/* 343744 E00320C4 16220005 */  bne       $s1, $v0, .LE00320DC
/* 343748 E00320C8 AC600038 */   sw       $zero, 0x38($v1)
/* 34374C E00320CC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 343750 E00320D0 44810000 */  mtc1      $at, $f0
/* 343754 E00320D4 0800C83C */  j         .LE00320F0
/* 343758 E00320D8 E4600020 */   swc1     $f0, 0x20($v1)
.LE00320DC:
/* 34375C E00320DC 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 343760 E00320E0 44810000 */  mtc1      $at, $f0
/* 343764 E00320E4 00000000 */  nop
/* 343768 E00320E8 E4600020 */  swc1      $f0, 0x20($v1)
/* 34376C E00320EC 24020001 */  addiu     $v0, $zero, 0x1
.LE00320F0:
/* 343770 E00320F0 16220005 */  bne       $s1, $v0, .LE0032108
/* 343774 E00320F4 00000000 */   nop
/* 343778 E00320F8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 34377C E00320FC 44810000 */  mtc1      $at, $f0
/* 343780 E0032100 0800C846 */  j         .LE0032118
/* 343784 E0032104 E4600024 */   swc1     $f0, 0x24($v1)
.LE0032108:
/* 343788 E0032108 3C014040 */  lui       $at, (0x40400000 >> 16)
/* 34378C E003210C 44810000 */  mtc1      $at, $f0
/* 343790 E0032110 00000000 */  nop
/* 343794 E0032114 E4600024 */  swc1      $f0, 0x24($v1)
.LE0032118:
/* 343798 E0032118 2463003C */  addiu     $v1, $v1, 0x3C
/* 34379C E003211C 240200FF */  addiu     $v0, $zero, 0xFF
/* 3437A0 E0032120 AC710000 */  sw        $s1, 0x0($v1)
/* 3437A4 E0032124 12200006 */  beqz      $s1, .LE0032140
/* 3437A8 E0032128 AC620038 */   sw       $v0, 0x38($v1)
/* 3437AC E003212C 24020001 */  addiu     $v0, $zero, 0x1
/* 3437B0 E0032130 1222000B */  beq       $s1, $v0, .LE0032160
/* 3437B4 E0032134 00000000 */   nop
/* 3437B8 E0032138 0800C860 */  j         .LE0032180
/* 3437BC E003213C 00000000 */   nop
.LE0032140:
/* 3437C0 E0032140 3C01411E */  lui       $at, (0x411E6666 >> 16)
/* 3437C4 E0032144 34216666 */  ori       $at, $at, (0x411E6666 & 0xFFFF)
/* 3437C8 E0032148 44810000 */  mtc1      $at, $f0
/* 3437CC E003214C 3C013FCC */  lui       $at, (0x3FCCCCCD >> 16)
/* 3437D0 E0032150 3421CCCD */  ori       $at, $at, (0x3FCCCCCD & 0xFFFF)
/* 3437D4 E0032154 44811000 */  mtc1      $at, $f2
/* 3437D8 E0032158 0800C867 */  j         .LE003219C
/* 3437DC E003215C E4600020 */   swc1     $f0, 0x20($v1)
.LE0032160:
/* 3437E0 E0032160 3C01415E */  lui       $at, (0x415E6666 >> 16)
/* 3437E4 E0032164 34216666 */  ori       $at, $at, (0x415E6666 & 0xFFFF)
/* 3437E8 E0032168 44810000 */  mtc1      $at, $f0
/* 3437EC E003216C 3C014019 */  lui       $at, (0x4019999A >> 16)
/* 3437F0 E0032170 3421999A */  ori       $at, $at, (0x4019999A & 0xFFFF)
/* 3437F4 E0032174 44811000 */  mtc1      $at, $f2
/* 3437F8 E0032178 0800C867 */  j         .LE003219C
/* 3437FC E003217C E4600020 */   swc1     $f0, 0x20($v1)
.LE0032180:
/* 343800 E0032180 3C01418E */  lui       $at, (0x418E6666 >> 16)
/* 343804 E0032184 34216666 */  ori       $at, $at, (0x418E6666 & 0xFFFF)
/* 343808 E0032188 44810000 */  mtc1      $at, $f0
/* 34380C E003218C 3C01404C */  lui       $at, (0x404CCCCD >> 16)
/* 343810 E0032190 3421CCCD */  ori       $at, $at, (0x404CCCCD & 0xFFFF)
/* 343814 E0032194 44811000 */  mtc1      $at, $f2
/* 343818 E0032198 E4600020 */  swc1      $f0, 0x20($v1)
.LE003219C:
/* 34381C E003219C E4620024 */  swc1      $f2, 0x24($v1)
/* 343820 E00321A0 3C0141F0 */  lui       $at, (0x41F00000 >> 16)
/* 343824 E00321A4 44810000 */  mtc1      $at, $f0
/* 343828 E00321A8 AC600028 */  sw        $zero, 0x28($v1)
/* 34382C E00321AC E460002C */  swc1      $f0, 0x2C($v1)
/* 343830 E00321B0 8FBF0030 */  lw        $ra, 0x30($sp)
/* 343834 E00321B4 8FB1002C */  lw        $s1, 0x2C($sp)
/* 343838 E00321B8 8FB00028 */  lw        $s0, 0x28($sp)
/* 34383C E00321BC D7B80048 */  ldc1      $f24, 0x48($sp)
/* 343840 E00321C0 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 343844 E00321C4 D7B40038 */  ldc1      $f20, 0x38($sp)
/* 343848 E00321C8 03E00008 */  jr        $ra
/* 34384C E00321CC 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void explosion_main(s32 type, f32 x, f32 y, f32 z) {
    EffectBlueprint bp;
    EffectBlueprint* bpPtr = &bp;
    EffectInstance* effect;
    ExplosionFXData* data;
    s32 numParts = 3;

    // TODO this terrible if-else required to match
    s32 dumb;
    s32 temp;
    if (type != 0) {
        dumb = 0;
    } else {
        temp = 0;
        dumb = temp;
    }

    bpPtr->unk_00 = 0;
    bpPtr->init = explosion_init;
    bpPtr->update = explosion_update;
    bpPtr->renderWorld = explosion_render;
    bpPtr->renderUI = NULL;
    bpPtr->effectID = EFFECT_EXPLOSION;

    effect = shim_create_effect_instance(bpPtr);
    effect->numParts = numParts;
    effect->data.explosion = data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
    ASSERT(effect->data.explosion != NULL);

    data->pos.x = x;
    data->pos.y = y;
    data->pos.z = z;
    data->unk_34 = 0;
    data->unk_30 = 60;
    data->unk_00 = type;

    data++;
    data->unk_00 = type;
    if (type == 0) {
        data->unk_00 = -1;
    }
    data->unk_38 = 0;
    if (type == 1) {
        data->unk_20 = 1.0f;
    } else {
        data->unk_20 = 3.0f;
    }
    if (type == 1) {
        data->unk_24 = 1.0f;
    } else {
        data->unk_24 = 3.0f;
    }

    data++;
    data->unk_00 = type;
    data->unk_38 = 255;
    switch (type) {
        case 0:
            data->unk_20 = 9.9f;
            data->unk_24 = 1.6f;
            break;
        case 1:
            data->unk_20 = 13.9f;
            data->unk_24 = 2.4f;
            break;
        default:
            data->unk_20 = 17.8f;
            data->unk_24 = 3.2f;
            break;
    }
    data->unk_28 = 0.0f;
    data->unk_2C = 30.0f;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel action_command_update
/* 197218 80268938 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 19721C 8026893C 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 197220 80268940 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 197224 80268944 30428000 */  andi      $v0, $v0, 0x8000
/* 197228 80268948 10400003 */  beqz      $v0, .L80268958
/* 19722C 8026894C AFBF0010 */   sw       $ra, 0x10($sp)
/* 197230 80268950 0C09A327 */  jal       action_command_free
/* 197234 80268954 00000000 */   nop
.L80268958:
/* 197238 80268958 3C02802A */  lui       $v0, %hi(gActionCommandStatus)
/* 19723C 8026895C 2442FBE0 */  addiu     $v0, $v0, %lo(gActionCommandStatus)
/* 197240 80268960 8443004A */  lh        $v1, 0x4A($v0)
/* 197244 80268964 2C620018 */  sltiu     $v0, $v1, 0x18
/* 197248 80268968 10400060 */  beqz      $v0, .L80268AEC
/* 19724C 8026896C 00031080 */   sll      $v0, $v1, 2
/* 197250 80268970 3C01802A */  lui       $at, %hi(jtbl_8029D6A0)
/* 197254 80268974 00220821 */  addu      $at, $at, $v0
/* 197258 80268978 8C22D6A0 */  lw        $v0, %lo(jtbl_8029D6A0)($at)
/* 19725C 8026897C 00400008 */  jr        $v0
/* 197260 80268980 00000000 */   nop
glabel .L80268984
/* 197264 80268984 0C0AA48D */  jal       func_802A9234
/* 197268 80268988 00000000 */   nop
/* 19726C 8026898C 0809A2BB */  j         .L80268AEC
/* 197270 80268990 00000000 */   nop
glabel .L80268994
/* 197274 80268994 0C0AA4DB */  jal       func_802A936C
/* 197278 80268998 00000000 */   nop
/* 19727C 8026899C 0809A2BB */  j         .L80268AEC
/* 197280 802689A0 00000000 */   nop
glabel .L802689A4
/* 197284 802689A4 0C0AA4DE */  jal       func_802A9378
/* 197288 802689A8 00000000 */   nop
/* 19728C 802689AC 0809A2BB */  j         .L80268AEC
/* 197290 802689B0 00000000 */   nop
glabel .L802689B4
/* 197294 802689B4 0C0AA4B7 */  jal       func_802A92DC
/* 197298 802689B8 00000000 */   nop
/* 19729C 802689BC 0809A2BB */  j         .L80268AEC
/* 1972A0 802689C0 00000000 */   nop
glabel .L802689C4
/* 1972A4 802689C4 0C0AA4BC */  jal       func_802A92F0
/* 1972A8 802689C8 00000000 */   nop
/* 1972AC 802689CC 0809A2BB */  j         .L80268AEC
/* 1972B0 802689D0 00000000 */   nop
glabel .L802689D4
/* 1972B4 802689D4 0C0AA47E */  jal       func_802A91F8
/* 1972B8 802689D8 00000000 */   nop
/* 1972BC 802689DC 0809A2BB */  j         .L80268AEC
/* 1972C0 802689E0 00000000 */   nop
glabel .L802689E4
/* 1972C4 802689E4 0C0AA48A */  jal       func_802A9228
/* 1972C8 802689E8 00000000 */   nop
/* 1972CC 802689EC 0809A2BB */  j         .L80268AEC
/* 1972D0 802689F0 00000000 */   nop
glabel .L802689F4
/* 1972D4 802689F4 0C0AA4A3 */  jal       func_802A928C
/* 1972D8 802689F8 00000000 */   nop
/* 1972DC 802689FC 0809A2BB */  j         .L80268AEC
/* 1972E0 80268A00 00000000 */   nop
glabel .L80268A04
/* 1972E4 80268A04 0C0AA4A5 */  jal       func_802A9294
/* 1972E8 80268A08 00000000 */   nop
/* 1972EC 80268A0C 0809A2BB */  j         .L80268AEC
/* 1972F0 80268A10 00000000 */   nop
glabel .L80268A14
/* 1972F4 80268A14 0C0AA4A3 */  jal       func_802A928C
/* 1972F8 80268A18 00000000 */   nop
/* 1972FC 80268A1C 0809A2BB */  j         .L80268AEC
/* 197300 80268A20 00000000 */   nop
glabel .L80268A24
/* 197304 80268A24 0C0AA4A3 */  jal       func_802A928C
/* 197308 80268A28 00000000 */   nop
/* 19730C 80268A2C 0809A2BB */  j         .L80268AEC
/* 197310 80268A30 00000000 */   nop
glabel .L80268A34
/* 197314 80268A34 0C0AA4B5 */  jal       func_802A92D4
/* 197318 80268A38 00000000 */   nop
/* 19731C 80268A3C 0809A2BB */  j         .L80268AEC
/* 197320 80268A40 00000000 */   nop
glabel .L80268A44
/* 197324 80268A44 0C0AA49E */  jal       func_802A9278
/* 197328 80268A48 00000000 */   nop
/* 19732C 80268A4C 0809A2BB */  j         .L80268AEC
/* 197330 80268A50 00000000 */   nop
glabel .L80268A54
/* 197334 80268A54 0C0AA4A5 */  jal       func_802A9294
/* 197338 80268A58 00000000 */   nop
/* 19733C 80268A5C 0809A2BB */  j         .L80268AEC
/* 197340 80268A60 00000000 */   nop
glabel .L80268A64
/* 197344 80268A64 0C0AA482 */  jal       func_802A9208
/* 197348 80268A68 00000000 */   nop
/* 19734C 80268A6C 0809A2BB */  j         .L80268AEC
/* 197350 80268A70 00000000 */   nop
glabel .L80268A74
/* 197354 80268A74 0C0AA4C4 */  jal       func_802A9310
/* 197358 80268A78 00000000 */   nop
/* 19735C 80268A7C 0809A2BB */  j         .L80268AEC
/* 197360 80268A80 00000000 */   nop
glabel .L80268A84
/* 197364 80268A84 0C0AA4A8 */  jal       func_802A92A0
/* 197368 80268A88 00000000 */   nop
/* 19736C 80268A8C 0809A2BB */  j         .L80268AEC
/* 197370 80268A90 00000000 */   nop
glabel .L80268A94
/* 197374 80268A94 0C0AA4A6 */  jal       func_802A9298
/* 197378 80268A98 00000000 */   nop
/* 19737C 80268A9C 0809A2BB */  j         .L80268AEC
/* 197380 80268AA0 00000000 */   nop
glabel .L80268AA4
/* 197384 80268AA4 0C0AA495 */  jal       func_802A9254
/* 197388 80268AA8 00000000 */   nop
/* 19738C 80268AAC 0809A2BB */  j         .L80268AEC
/* 197390 80268AB0 00000000 */   nop
glabel .L80268AB4
/* 197394 80268AB4 0C0AA4A8 */  jal       func_802A92A0
/* 197398 80268AB8 00000000 */   nop
/* 19739C 80268ABC 0809A2BB */  j         .L80268AEC
/* 1973A0 80268AC0 00000000 */   nop
glabel .L80268AC4
/* 1973A4 80268AC4 0C0AA4A6 */  jal       func_802A9298
/* 1973A8 80268AC8 00000000 */   nop
/* 1973AC 80268ACC 0809A2BB */  j         .L80268AEC
/* 1973B0 80268AD0 00000000 */   nop
glabel .L80268AD4
/* 1973B4 80268AD4 0C0AA523 */  jal       func_802A948C
/* 1973B8 80268AD8 00000000 */   nop
/* 1973BC 80268ADC 0809A2BB */  j         .L80268AEC
/* 1973C0 80268AE0 00000000 */   nop
glabel .L80268AE4
/* 1973C4 80268AE4 0C0AA48A */  jal       func_802A9228
/* 1973C8 80268AE8 00000000 */   nop
glabel .L80268AEC
/* 1973CC 80268AEC 8FBF0010 */  lw        $ra, 0x10($sp)
/* 1973D0 80268AF0 03E00008 */  jr        $ra
/* 1973D4 80268AF4 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void action_command_update(void) {
    ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;

    if (gBattleStatus.flags1 & BS_FLAGS1_8000) {
        action_command_free();
    }

    switch (actionCommandStatus->actionCommandID) {
        case ACTION_COMMAND_NONE:
            break;
        case ACTION_COMMAND_JUMP:
            action_command_jump_update();
            break;
        case ACTION_COMMAND_SMASH:
            action_command_hammer_update();
            break;
        case ACTION_COMMAND_FLEE:
            action_command_flee_update();
            break;
        case ACTION_COMMAND_BREAK_FREE:
            action_command_break_free_update();
            break;
        case ACTION_COMMAND_WHIRLWIND:
            action_command_whirlwind_update();
            break;
        case ACTION_COMMAND_STOP_LEECH:
            action_command_stop_leech_update();
            break;
        case ACTION_COMMAND_07:
            action_command_07_update();
            break;
        case ACTION_COMMAND_DIZZY_SHELL:
            action_command_dizzy_shell_update();
            break;
        case ACTION_COMMAND_FIRE_SHELL:
            action_command_fire_shell_update();
            break;
        case ACTION_COMMAND_0A:
            action_command_0A_update();
            break;
        case ACTION_COMMAND_BOMB:
            action_command_bomb_update();
            break;
        case ACTION_COMMAND_BODY_SLAM:
            action_command_body_slam_update();
            break;
        case ACTION_COMMAND_AIR_LIFT:
            action_command_air_lift_update();
            break;
        case ACTION_COMMAND_AIR_RAID:
            action_command_air_raid_update();
            break;
        case ACTION_COMMAND_SQUIRT:
            action_command_squirt_update();
            break;
        case ACTION_COMMAND_POWER_SHOCK:
            action_command_power_shock_update();
            break;
        case ACTION_COMMAND_MEGA_SHOCK:
            action_command_mega_shock_update();
            break;
        case ACTION_COMMAND_SMACK:
            action_command_smack_update();
            break;
        case ACTION_COMMAND_SPINY_SURGE:
            action_command_spiny_surge_update();
            break;
        case ACTION_COMMAND_HURRICANE:
            action_command_hurricane_update();
            break;
        case ACTION_COMMAND_SPOOK:
            action_command_spook_update();
            break;
        case ACTION_COMMAND_WATER_BLOCK:
            action_command_water_block_update();
            break;
        case ACTION_COMMAND_TIDAL_WAVE:
            action_command_tidal_wave_update();
            break;
        default:
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel draw_message_window
/* BE2A4 80127BA4 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* BE2A8 80127BA8 0080402D */  daddu     $t0, $a0, $zero
/* BE2AC 80127BAC 2402000D */  addiu     $v0, $zero, 0xD
/* BE2B0 80127BB0 AFBF0050 */  sw        $ra, 0x50($sp)
/* BE2B4 80127BB4 910304F8 */  lbu       $v1, 0x4F8($t0)
/* BE2B8 80127BB8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* BE2BC 80127BBC 44810000 */  mtc1      $at, $f0
/* BE2C0 80127BC0 10620006 */  beq       $v1, $v0, .L80127BDC
/* BE2C4 80127BC4 0000482D */   daddu    $t1, $zero, $zero
/* BE2C8 80127BC8 2402000E */  addiu     $v0, $zero, 0xE
/* BE2CC 80127BCC 1062001D */  beq       $v1, $v0, .L80127C44
/* BE2D0 80127BD0 2862000F */   slti     $v0, $v1, 0xF
/* BE2D4 80127BD4 08049F2B */  j         .L80127CAC
/* BE2D8 80127BD8 00000000 */   nop
.L80127BDC:
/* BE2DC 80127BDC 24050004 */  addiu     $a1, $zero, 0x4
/* BE2E0 80127BE0 91030509 */  lbu       $v1, 0x509($t0)
/* BE2E4 80127BE4 3C014059 */  lui       $at, (0x40590000 >> 16)
/* BE2E8 80127BE8 44811800 */  mtc1      $at, $f3
/* BE2EC 80127BEC 44801000 */  mtc1      $zero, $f2
/* BE2F0 80127BF0 00A32023 */  subu      $a0, $a1, $v1
/* BE2F4 80127BF4 00041040 */  sll       $v0, $a0, 1
/* BE2F8 80127BF8 00444821 */  addu      $t1, $v0, $a0
/* BE2FC 80127BFC 3C028015 */  lui       $v0, %hi(D_8014C580)
/* BE300 80127C00 00431021 */  addu      $v0, $v0, $v1
/* BE304 80127C04 9042C580 */  lbu       $v0, %lo(D_8014C580)($v0)
/* BE308 80127C08 24630001 */  addiu     $v1, $v1, 0x1
/* BE30C 80127C0C A1030509 */  sb        $v1, 0x509($t0)
/* BE310 80127C10 44820000 */  mtc1      $v0, $f0
/* BE314 80127C14 00000000 */  nop
/* BE318 80127C18 46800020 */  cvt.s.w   $f0, $f0
/* BE31C 80127C1C 46000021 */  cvt.d.s   $f0, $f0
/* BE320 80127C20 306200FF */  andi      $v0, $v1, 0xFF
/* BE324 80127C24 46220003 */  div.d     $f0, $f0, $f2
/* BE328 80127C28 3C018015 */  lui       $at, %hi(D_8014C580)
/* BE32C 80127C2C 00220821 */  addu      $at, $at, $v0
/* BE330 80127C30 9022C580 */  lbu       $v0, %lo(D_8014C580)($at)
/* BE334 80127C34 1440001B */  bnez      $v0, .L80127CA4
/* BE338 80127C38 46200020 */   cvt.s.d  $f0, $f0
/* BE33C 80127C3C 08049F29 */  j         .L80127CA4
/* BE340 80127C40 A10504F8 */   sb       $a1, 0x4F8($t0)
.L80127C44:
/* BE344 80127C44 91020512 */  lbu       $v0, 0x512($t0)
/* BE348 80127C48 3C014059 */  lui       $at, (0x40590000 >> 16)
/* BE34C 80127C4C 44811800 */  mtc1      $at, $f3
/* BE350 80127C50 44801000 */  mtc1      $zero, $f2
/* BE354 80127C54 00024823 */  negu      $t1, $v0
/* BE358 80127C58 3C038015 */  lui       $v1, %hi(D_8014C588)
/* BE35C 80127C5C 00621821 */  addu      $v1, $v1, $v0
/* BE360 80127C60 9063C588 */  lbu       $v1, %lo(D_8014C588)($v1)
/* BE364 80127C64 24420001 */  addiu     $v0, $v0, 0x1
/* BE368 80127C68 A1020512 */  sb        $v0, 0x512($t0)
/* BE36C 80127C6C 304200FF */  andi      $v0, $v0, 0xFF
/* BE370 80127C70 3C018015 */  lui       $at, %hi(D_8014C588)
/* BE374 80127C74 00220821 */  addu      $at, $at, $v0
/* BE378 80127C78 9022C588 */  lbu       $v0, %lo(D_8014C588)($at)
/* BE37C 80127C7C 44830000 */  mtc1      $v1, $f0
/* BE380 80127C80 00000000 */  nop
/* BE384 80127C84 46800020 */  cvt.s.w   $f0, $f0
/* BE388 80127C88 46000021 */  cvt.d.s   $f0, $f0
/* BE38C 80127C8C 46220003 */  div.d     $f0, $f0, $f2
/* BE390 80127C90 14400004 */  bnez      $v0, .L80127CA4
/* BE394 80127C94 46200020 */   cvt.s.d  $f0, $f0
/* BE398 80127C98 8D0204FC */  lw        $v0, 0x4FC($t0)
/* BE39C 80127C9C 34420001 */  ori       $v0, $v0, 0x1
/* BE3A0 80127CA0 AD0204FC */  sw        $v0, 0x4FC($t0)
.L80127CA4:
/* BE3A4 80127CA4 910304F8 */  lbu       $v1, 0x4F8($t0)
/* BE3A8 80127CA8 2862000F */  slti      $v0, $v1, 0xF
.L80127CAC:
/* BE3AC 80127CAC 1040002B */  beqz      $v0, .L80127D5C
/* BE3B0 80127CB0 2862000D */   slti     $v0, $v1, 0xD
/* BE3B4 80127CB4 1440002A */  bnez      $v0, .L80127D60
/* BE3B8 80127CB8 0100202D */   daddu    $a0, $t0, $zero
/* BE3BC 80127CBC 24040001 */  addiu     $a0, $zero, 0x1
/* BE3C0 80127CC0 24070038 */  addiu     $a3, $zero, 0x38
/* BE3C4 80127CC4 95030514 */  lhu       $v1, 0x514($t0)
/* BE3C8 80127CC8 240200A0 */  addiu     $v0, $zero, 0xA0
/* BE3CC 80127CCC 00831806 */  srlv      $v1, $v1, $a0
/* BE3D0 80127CD0 00431023 */  subu      $v0, $v0, $v1
/* BE3D4 80127CD4 A502045A */  sh        $v0, 0x45A($t0)
/* BE3D8 80127CD8 8506045A */  lh        $a2, 0x45A($t0)
/* BE3DC 80127CDC 00E0102D */  daddu     $v0, $a3, $zero
/* BE3E0 80127CE0 A502045C */  sh        $v0, 0x45C($t0)
/* BE3E4 80127CE4 AFA00010 */  sw        $zero, 0x10($sp)
/* BE3E8 80127CE8 95020514 */  lhu       $v0, 0x514($t0)
/* BE3EC 80127CEC 0000282D */  daddu     $a1, $zero, $zero
/* BE3F0 80127CF0 AFA20014 */  sw        $v0, 0x14($sp)
/* BE3F4 80127CF4 95030516 */  lhu       $v1, 0x516($t0)
/* BE3F8 80127CF8 240200FF */  addiu     $v0, $zero, 0xFF
/* BE3FC 80127CFC E7A00024 */  swc1      $f0, 0x24($sp)
/* BE400 80127D00 E7A00028 */  swc1      $f0, 0x28($sp)
/* BE404 80127D04 44890000 */  mtc1      $t1, $f0
/* BE408 80127D08 00000000 */  nop
/* BE40C 80127D0C 46800020 */  cvt.s.w   $f0, $f0
/* BE410 80127D10 AFA2001C */  sw        $v0, 0x1C($sp)
/* BE414 80127D14 3C028012 */  lui       $v0, %hi(drawbox_message_delegate)
/* BE418 80127D18 24427B70 */  addiu     $v0, $v0, %lo(drawbox_message_delegate)
/* BE41C 80127D1C AFA20038 */  sw        $v0, 0x38($sp)
/* BE420 80127D20 24020140 */  addiu     $v0, $zero, 0x140
/* BE424 80127D24 AFA20044 */  sw        $v0, 0x44($sp)
/* BE428 80127D28 240200F0 */  addiu     $v0, $zero, 0xF0
/* BE42C 80127D2C AFA00020 */  sw        $zero, 0x20($sp)
/* BE430 80127D30 AFA0002C */  sw        $zero, 0x2C($sp)
/* BE434 80127D34 AFA00030 */  sw        $zero, 0x30($sp)
/* BE438 80127D38 E7A00034 */  swc1      $f0, 0x34($sp)
/* BE43C 80127D3C AFA8003C */  sw        $t0, 0x3C($sp)
/* BE440 80127D40 AFA00040 */  sw        $zero, 0x40($sp)
/* BE444 80127D44 AFA20048 */  sw        $v0, 0x48($sp)
/* BE448 80127D48 AFA0004C */  sw        $zero, 0x4C($sp)
/* BE44C 80127D4C 0C03D4B8 */  jal       draw_box
/* BE450 80127D50 AFA30018 */   sw       $v1, 0x18($sp)
/* BE454 80127D54 08049F61 */  j         .L80127D84
/* BE458 80127D58 00000000 */   nop
.L80127D5C:
/* BE45C 80127D5C 0100202D */  daddu     $a0, $t0, $zero
.L80127D60:
/* BE460 80127D60 84850456 */  lh        $a1, 0x456($a0)
/* BE464 80127D64 84860458 */  lh        $a2, 0x458($a0)
/* BE468 80127D68 9487046E */  lhu       $a3, 0x46E($a0)
/* BE46C 80127D6C 94830462 */  lhu       $v1, 0x462($a0)
/* BE470 80127D70 24020004 */  addiu     $v0, $zero, 0x4
/* BE474 80127D74 AFA20014 */  sw        $v0, 0x14($sp)
/* BE478 80127D78 AFA00018 */  sw        $zero, 0x18($sp)
/* BE47C 80127D7C 0C049F64 */  jal       appendGfx_message
/* BE480 80127D80 AFA30010 */   sw       $v1, 0x10($sp)
.L80127D84:
/* BE484 80127D84 8FBF0050 */  lw        $ra, 0x50($sp)
/* BE488 80127D88 03E00008 */  jr        $ra
/* BE48C 80127D8C 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void draw_message_window(MessagePrintState* printer) {
    f32 scale = 1.0f;
    s32 rotZ = 0;

    switch (printer->windowState) {
        case MSG_WINDOW_STATE_D:
            scale = (f32)D_8014C580[printer->fadeInCounter] / 100.0;
            rotZ = (4 - printer->fadeInCounter) * 3;
            printer->fadeInCounter++;
            if (D_8014C580[printer->fadeInCounter] == 0) {
                printer->windowState = MSG_WINDOW_STATE_PRINTING;
            }
            break;
        case MSG_WINDOW_STATE_E:
            scale = (f32)D_8014C588[printer->fadeOutCounter] / 100.0;
            rotZ = -printer->fadeOutCounter;
            printer->fadeOutCounter++;
            if (D_8014C588[printer->fadeOutCounter] == 0) {
                printer->stateFlags |= MSG_STATE_FLAG_1;
            }
            break;
    }

    switch (printer->windowState) {
        case MSG_WINDOW_STATE_D:
        case MSG_WINDOW_STATE_E:
            printer->windowBasePos.x = 160 - (printer->windowSize.x / 2);
            printer->windowBasePos.y = 56;
            draw_box(DRAW_FLAG_ROTSCALE, WINDOW_STYLE_0, printer->windowBasePos.x, 56, 0, printer->windowSize.x, printer->windowSize.y, 255, 0,
                     scale, scale, 0.0f, 0.0f, rotZ, drawbox_message_delegate, printer, NULL, SCREEN_WIDTH,
                     SCREEN_HEIGHT, NULL);
            break;
        default:
            appendGfx_message(printer, printer->windowOffsetPos.x, printer->windowOffsetPos.y, printer->unk_46C,
                              printer->curLinePos, 4, 0);
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_802A2AB8_7AA458
/* 417848 802A2AB8 27BDFFE0 */  addiu     $sp, $sp, -0x20
D_802A2ABC_7AA45C:
/* 41784C 802A2ABC 24040001 */  addiu     $a0, $zero, 0x1
/* 417850 802A2AC0 24050005 */  addiu     $a1, $zero, 0x5
/* 417854 802A2AC4 AFBF0018 */  sw        $ra, 0x18($sp)
/* 417858 802A2AC8 AFB10014 */  sw        $s1, 0x14($sp)
/* 41785C 802A2ACC 0C051F9F */  jal       set_window_update
/* 417860 802A2AD0 AFB00010 */   sw       $s0, 0x10($sp)
/* 417864 802A2AD4 3C02802B */  lui       $v0, %hi(BattleMenu_UsingSpiritsSubmenu)
/* 417868 802A2AD8 8C42D4A0 */  lw        $v0, %lo(BattleMenu_UsingSpiritsSubmenu)($v0)
/* 41786C 802A2ADC 54400006 */  bnel      $v0, $zero, .L802A2AF8_7AA498
/* 417870 802A2AE0 24040004 */   addiu    $a0, $zero, 0x4
/* 417874 802A2AE4 24040002 */  addiu     $a0, $zero, 0x2
/* 417878 802A2AE8 0C051F9F */  jal       set_window_update
/* 41787C 802A2AEC 24050005 */   addiu    $a1, $zero, 0x5
/* 417880 802A2AF0 080A8AC1 */  j         .L802A2B04_7AA4A4
/* 417884 802A2AF4 24040003 */   addiu    $a0, $zero, 0x3
.L802A2AF8_7AA498:
/* 417888 802A2AF8 0C051F9F */  jal       set_window_update
D_802A2AFC_7AA49C:
/* 41788C 802A2AFC 24050005 */   addiu    $a1, $zero, 0x5
/* 417890 802A2B00 24040005 */  addiu     $a0, $zero, 0x5
.L802A2B04_7AA4A4:
/* 417894 802A2B04 0C051F9F */  jal       set_window_update
/* 417898 802A2B08 24050005 */   addiu    $a1, $zero, 0x5
/* 41789C 802A2B0C 24040008 */  addiu     $a0, $zero, 0x8
/* 4178A0 802A2B10 0C051F9F */  jal       set_window_update
/* 4178A4 802A2B14 24050001 */   addiu    $a1, $zero, 0x1
/* 4178A8 802A2B18 3C02802B */  lui       $v0, %hi(BattleMenu_Moves_OptionCount)
/* 4178AC 802A2B1C 8C42D4A4 */  lw        $v0, %lo(BattleMenu_Moves_OptionCount)($v0)
/* 4178B0 802A2B20 1840000F */  blez      $v0, .L802A2B60_7AA500
/* 4178B4 802A2B24 0000802D */   daddu    $s0, $zero, $zero
/* 4178B8 802A2B28 3C11802B */  lui       $s1, %hi(BattleMenu_Moves_OptionIDs)
/* 4178BC 802A2B2C 2631D128 */  addiu     $s1, $s1, %lo(BattleMenu_Moves_OptionIDs)
/* 4178C0 802A2B30 240500FF */  addiu     $a1, $zero, 0xFF
.L802A2B34_7AA4D4:
/* 4178C4 802A2B34 00A0302D */  daddu     $a2, $a1, $zero
/* 4178C8 802A2B38 00A0382D */  daddu     $a3, $a1, $zero
/* 4178CC 802A2B3C 8E240000 */  lw        $a0, 0x0($s1)
/* 4178D0 802A2B40 0C0513BF */  jal       hud_element_set_tint
/* 4178D4 802A2B44 26310004 */   addiu    $s1, $s1, 0x4
/* 4178D8 802A2B48 3C02802B */  lui       $v0, %hi(BattleMenu_Moves_OptionCount)
/* 4178DC 802A2B4C 8C42D4A4 */  lw        $v0, %lo(BattleMenu_Moves_OptionCount)($v0)
/* 4178E0 802A2B50 26100001 */  addiu     $s0, $s0, 0x1
/* 4178E4 802A2B54 0202102A */  slt       $v0, $s0, $v0
/* 4178E8 802A2B58 1440FFF6 */  bnez      $v0, .L802A2B34_7AA4D4
/* 4178EC 802A2B5C 240500FF */   addiu    $a1, $zero, 0xFF
.L802A2B60_7AA500:
/* 4178F0 802A2B60 240500FF */  addiu     $a1, $zero, 0xFF
/* 4178F4 802A2B64 00A0302D */  daddu     $a2, $a1, $zero
/* 4178F8 802A2B68 3C04802B */  lui       $a0, %hi(BattleMenu_Moves_CursorID)
/* 4178FC 802A2B6C 8C84D118 */  lw        $a0, %lo(BattleMenu_Moves_CursorID)($a0)
D_802A2B70_7AA510:
/* 417900 802A2B70 0C0513BF */  jal       hud_element_set_tint
/* 417904 802A2B74 00A0382D */   daddu    $a3, $a1, $zero
/* 417908 802A2B78 240500FF */  addiu     $a1, $zero, 0xFF
/* 41790C 802A2B7C 00A0302D */  daddu     $a2, $a1, $zero
/* 417910 802A2B80 3C04802B */  lui       $a0, %hi(BattleMenu_Moves_UpArrowID)
/* 417914 802A2B84 8C84D11C */  lw        $a0, %lo(BattleMenu_Moves_UpArrowID)($a0)
/* 417918 802A2B88 0C0513BF */  jal       hud_element_set_tint
/* 41791C 802A2B8C 00A0382D */   daddu    $a3, $a1, $zero
/* 417920 802A2B90 240500FF */  addiu     $a1, $zero, 0xFF
/* 417924 802A2B94 00A0302D */  daddu     $a2, $a1, $zero
/* 417928 802A2B98 3C04802B */  lui       $a0, %hi(BattleMenu_Moves_DownArrowID)
/* 41792C 802A2B9C 8C84D120 */  lw        $a0, %lo(BattleMenu_Moves_DownArrowID)($a0)
/* 417930 802A2BA0 0C0513BF */  jal       hud_element_set_tint
/* 417934 802A2BA4 00A0382D */   daddu    $a3, $a1, $zero
/* 417938 802A2BA8 240500FF */  addiu     $a1, $zero, 0xFF
/* 41793C 802A2BAC 00A0302D */  daddu     $a2, $a1, $zero
/* 417940 802A2BB0 3C04802B */  lui       $a0, %hi(BattleMenu_Moves_TitleID)
/* 417944 802A2BB4 8C84D188 */  lw        $a0, %lo(BattleMenu_Moves_TitleID)($a0)
/* 417948 802A2BB8 0C0513BF */  jal       hud_element_set_tint
/* 41794C 802A2BBC 00A0382D */   daddu    $a3, $a1, $zero
/* 417950 802A2BC0 3C02802B */  lui       $v0, %hi(BattleMenu_Moves_OptionCount)
/* 417954 802A2BC4 8C42D4A4 */  lw        $v0, %lo(BattleMenu_Moves_OptionCount)($v0)
/* 417958 802A2BC8 1840000F */  blez      $v0, .L802A2C08_7AA5A8
/* 41795C 802A2BCC 0000802D */   daddu    $s0, $zero, $zero
/* 417960 802A2BD0 3C11802B */  lui       $s1, %hi(BattleMenu_Moves_OptionCostUnitIDs)
/* 417964 802A2BD4 2631D190 */  addiu     $s1, $s1, %lo(BattleMenu_Moves_OptionCostUnitIDs)
/* 417968 802A2BD8 240500FF */  addiu     $a1, $zero, 0xFF
.L802A2BDC_7AA57C:
/* 41796C 802A2BDC 00A0302D */  daddu     $a2, $a1, $zero
/* 417970 802A2BE0 00A0382D */  daddu     $a3, $a1, $zero
/* 417974 802A2BE4 8E240000 */  lw        $a0, 0x0($s1)
/* 417978 802A2BE8 0C0513BF */  jal       hud_element_set_tint
/* 41797C 802A2BEC 26310004 */   addiu    $s1, $s1, 0x4
/* 417980 802A2BF0 3C02802B */  lui       $v0, %hi(BattleMenu_Moves_OptionCount)
/* 417984 802A2BF4 8C42D4A4 */  lw        $v0, %lo(BattleMenu_Moves_OptionCount)($v0)
/* 417988 802A2BF8 26100001 */  addiu     $s0, $s0, 0x1
/* 41798C 802A2BFC 0202102A */  slt       $v0, $s0, $v0
/* 417990 802A2C00 1440FFF6 */  bnez      $v0, .L802A2BDC_7AA57C
/* 417994 802A2C04 240500FF */   addiu    $a1, $zero, 0xFF
.L802A2C08_7AA5A8:
/* 417998 802A2C08 3C04802B */  lui       $a0, %hi(BattleMenu_Moves_CursorID)
D_802A2C0C_7AA5AC:
/* 41799C 802A2C0C 8C84D118 */  lw        $a0, %lo(BattleMenu_Moves_CursorID)($a0)
/* 4179A0 802A2C10 3C058010 */  lui       $a1, %hi(HES_AnimatedHandPointer)
/* 4179A4 802A2C14 24A54A28 */  addiu     $a1, $a1, %lo(HES_AnimatedHandPointer)
/* 4179A8 802A2C18 0C0511FF */  jal       hud_element_set_script
/* 4179AC 802A2C1C 00000000 */   nop
D_802A2C20_7AA5C0:
/* 4179B0 802A2C20 8FBF0018 */  lw        $ra, 0x18($sp)
/* 4179B4 802A2C24 8FB10014 */  lw        $s1, 0x14($sp)
/* 4179B8 802A2C28 8FB00010 */  lw        $s0, 0x10($sp)
/* 4179BC 802A2C2C 2402000A */  addiu     $v0, $zero, 0xA
/* 4179C0 802A2C30 3C01802B */  lui       $at, %hi(BattleMenu_Moves_TextColor)
/* 4179C4 802A2C34 A422D114 */  sh        $v0, %lo(BattleMenu_Moves_TextColor)($at)
/* 4179C8 802A2C38 24020001 */  addiu     $v0, $zero, 0x1
/* 4179CC 802A2C3C 3C01802B */  lui       $at, %hi(D_802AD10F)
D_802A2C40_7AA5E0:
/* 4179D0 802A2C40 A022D10F */  sb        $v0, %lo(D_802AD10F)($at)
/* 4179D4 802A2C44 24020014 */  addiu     $v0, $zero, 0x14
/* 4179D8 802A2C48 3C01802B */  lui       $at, %hi(battle_menu_moveState)
/* 4179DC 802A2C4C A022D108 */  sb        $v0, %lo(battle_menu_moveState)($at)
D_802A2C50_7AA5F0:
/* 4179E0 802A2C50 03E00008 */  jr        $ra
/* 4179E4 802A2C54 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void func_802A2AB8(void) {
    s32* moveOptionIconIDs;
    s32* moveOptionCostUnitIconIDs;
    s32 i;

    set_window_update(WINDOW_ID_1, WINDOW_UPDATE_TRANSPARENT);

    if (!BattleMenu_UsingSpiritsSubmenu) {
        set_window_update(WINDOW_ID_2, WINDOW_UPDATE_TRANSPARENT);
        set_window_update(WINDOW_ID_3, WINDOW_UPDATE_TRANSPARENT);
    } else {
        set_window_update(WINDOW_ID_4, WINDOW_UPDATE_TRANSPARENT);
        set_window_update(WINDOW_ID_5, WINDOW_UPDATE_TRANSPARENT);
    }
    set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW);

    moveOptionIconIDs = BattleMenu_Moves_OptionIDs;

    for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
        hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255);
    }

    hud_element_set_tint(BattleMenu_Moves_CursorID, 255, 255, 255);
    hud_element_set_tint(BattleMenu_Moves_UpArrowID, 255, 255, 255);
    hud_element_set_tint(BattleMenu_Moves_DownArrowID, 255, 255, 255);
    hud_element_set_tint(BattleMenu_Moves_TitleID, 255, 255, 255);

    moveOptionCostUnitIconIDs = BattleMenu_Moves_OptionCostUnitIDs;

    for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
        hud_element_set_tint(moveOptionCostUnitIconIDs[i], 255, 255, 255);
    }

    hud_element_set_script(BattleMenu_Moves_CursorID, &HES_AnimatedHandPointer);
    BattleMenu_Moves_TextColor = MSG_PAL_STANDARD;
    D_802AD10F = 1;
    battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_14;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel get_overriding_player_anim
/* 791F8 800DFD48 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 791FC 800DFD4C AFB00010 */  sw        $s0, 0x10($sp)
/* 79200 800DFD50 0080802D */  daddu     $s0, $a0, $zero
/* 79204 800DFD54 3C058011 */  lui       $a1, %hi(gPlayerStatus)
/* 79208 800DFD58 24A5EFC8 */  addiu     $a1, $a1, %lo(gPlayerStatus)
/* 7920C 800DFD5C 3C048011 */  lui       $a0, %hi(gPartnerStatus)
/* 79210 800DFD60 2484EBB0 */  addiu     $a0, $a0, %lo(gPartnerStatus)
/* 79214 800DFD64 AFBF0014 */  sw        $ra, 0x14($sp)
/* 79218 800DFD68 80A300B4 */  lb        $v1, 0xB4($a1)
/* 7921C 800DFD6C 2402001D */  addiu     $v0, $zero, 0x1D
/* 79220 800DFD70 14620007 */  bne       $v1, $v0, .L800DFD90
/* 79224 800DFD74 3C020001 */   lui      $v0, (0x1002B >> 16)
/* 79228 800DFD78 3442002B */  ori       $v0, $v0, (0x1002B & 0xFFFF)
/* 7922C 800DFD7C 12020004 */  beq       $s0, $v0, .L800DFD90
/* 79230 800DFD80 3C020001 */   lui      $v0, (0x10007 >> 16)
/* 79234 800DFD84 34420007 */  ori       $v0, $v0, (0x10007 & 0xFFFF)
/* 79238 800DFD88 16020058 */  bne       $s0, $v0, .L800DFEEC
/* 7923C 800DFD8C 2402FFFF */   addiu    $v0, $zero, -0x1
.L800DFD90:
/* 79240 800DFD90 80820000 */  lb        $v0, 0x0($a0)
/* 79244 800DFD94 10400017 */  beqz      $v0, .L800DFDF4
/* 79248 800DFD98 24020008 */   addiu    $v0, $zero, 0x8
/* 7924C 800DFD9C 80830003 */  lb        $v1, 0x3($a0)
/* 79250 800DFDA0 14620006 */  bne       $v1, $v0, .L800DFDBC
/* 79254 800DFDA4 3C020001 */   lui      $v0, (0x10002 >> 16)
/* 79258 800DFDA8 34420002 */  ori       $v0, $v0, (0x10002 & 0xFFFF)
/* 7925C 800DFDAC 16020003 */  bne       $s0, $v0, .L800DFDBC
/* 79260 800DFDB0 00000000 */   nop
/* 79264 800DFDB4 3C100008 */  lui       $s0, (0x8000E >> 16)
/* 79268 800DFDB8 3610000E */  ori       $s0, $s0, (0x8000E & 0xFFFF)
.L800DFDBC:
/* 7926C 800DFDBC 80820000 */  lb        $v0, 0x0($a0)
/* 79270 800DFDC0 1040000C */  beqz      $v0, .L800DFDF4
/* 79274 800DFDC4 24020009 */   addiu    $v0, $zero, 0x9
/* 79278 800DFDC8 80830003 */  lb        $v1, 0x3($a0)
/* 7927C 800DFDCC 1462000A */  bne       $v1, $v0, .L800DFDF8
/* 79280 800DFDD0 3C020001 */   lui      $v0, (0x10014 >> 16)
/* 79284 800DFDD4 34420014 */  ori       $v0, $v0, (0x10014 & 0xFFFF)
/* 79288 800DFDD8 12020006 */  beq       $s0, $v0, .L800DFDF4
/* 7928C 800DFDDC 3C020001 */   lui      $v0, (0x10002 >> 16)
/* 79290 800DFDE0 34420002 */  ori       $v0, $v0, (0x10002 & 0xFFFF)
/* 79294 800DFDE4 12020004 */  beq       $s0, $v0, .L800DFDF8
/* 79298 800DFDE8 3C020001 */   lui      $v0, (0x10032 >> 16)
.L800DFDEC:
/* 7929C 800DFDEC 08037FBB */  j         .L800DFEEC
/* 792A0 800DFDF0 2402FFFF */   addiu    $v0, $zero, -0x1
.L800DFDF4:
/* 792A4 800DFDF4 3C020001 */  lui       $v0, (0x10032 >> 16)
.L800DFDF8:
/* 792A8 800DFDF8 34420032 */  ori       $v0, $v0, (0x10032 & 0xFFFF)
/* 792AC 800DFDFC 16020005 */  bne       $s0, $v0, .L800DFE14
/* 792B0 800DFE00 3C020006 */   lui      $v0, (0x6000C >> 16)
/* 792B4 800DFE04 80830000 */  lb        $v1, 0x0($a0)
/* 792B8 800DFE08 24020001 */  addiu     $v0, $zero, 0x1
/* 792BC 800DFE0C 1062FFF7 */  beq       $v1, $v0, .L800DFDEC
/* 792C0 800DFE10 3C020006 */   lui      $v0, (0x6000C >> 16)
.L800DFE14:
/* 792C4 800DFE14 3442000C */  ori       $v0, $v0, (0x6000C & 0xFFFF)
/* 792C8 800DFE18 12020007 */  beq       $s0, $v0, .L800DFE38
/* 792CC 800DFE1C 3C02000C */   lui      $v0, (0xC0010 >> 16)
/* 792D0 800DFE20 34420010 */  ori       $v0, $v0, (0xC0010 & 0xFFFF)
/* 792D4 800DFE24 12020004 */  beq       $s0, $v0, .L800DFE38
/* 792D8 800DFE28 3C020001 */   lui      $v0, (0x10002 >> 16)
/* 792DC 800DFE2C 34420002 */  ori       $v0, $v0, (0x10002 & 0xFFFF)
/* 792E0 800DFE30 1602001A */  bne       $s0, $v0, .L800DFE9C
/* 792E4 800DFE34 00000000 */   nop
.L800DFE38:
/* 792E8 800DFE38 8CA30004 */  lw        $v1, 0x4($a1)
/* 792EC 800DFE3C 30621000 */  andi      $v0, $v1, 0x1000
/* 792F0 800DFE40 14400007 */  bnez      $v0, .L800DFE60
/* 792F4 800DFE44 30622000 */   andi     $v0, $v1, 0x2000
/* 792F8 800DFE48 0C037F3D */  jal       is_player_dismounted
/* 792FC 800DFE4C 00000000 */   nop
/* 79300 800DFE50 1440001E */  bnez      $v0, .L800DFECC
/* 79304 800DFE54 3C020008 */   lui      $v0, (0x80003 >> 16)
/* 79308 800DFE58 08037FBB */  j         .L800DFEEC
/* 7930C 800DFE5C 2402FFFF */   addiu    $v0, $zero, -0x1
.L800DFE60:
/* 79310 800DFE60 14400003 */  bnez      $v0, .L800DFE70
/* 79314 800DFE64 3C10000C */   lui      $s0, (0xC0010 >> 16)
/* 79318 800DFE68 08037FB2 */  j         .L800DFEC8
/* 7931C 800DFE6C 36100010 */   ori      $s0, $s0, (0xC0010 & 0xFFFF)
.L800DFE70:
/* 79320 800DFE70 80A3000C */  lb        $v1, 0xC($a1)
/* 79324 800DFE74 00031040 */  sll       $v0, $v1, 1
/* 79328 800DFE78 00431021 */  addu      $v0, $v0, $v1
/* 7932C 800DFE7C 000210C0 */  sll       $v0, $v0, 3
/* 79330 800DFE80 3C04800F */  lui       $a0, %hi(BasicPeachDisguiseAnims + 0x14)
/* 79334 800DFE84 00822021 */  addu      $a0, $a0, $v0
/* 79338 800DFE88 8C847C30 */  lw        $a0, %lo(BasicPeachDisguiseAnims + 0x14)($a0)
/* 7933C 800DFE8C 0C0398DB */  jal       peach_set_disguise_anim
/* 79340 800DFE90 00000000 */   nop
/* 79344 800DFE94 08037FBB */  j         .L800DFEEC
/* 79348 800DFE98 2402FFFF */   addiu    $v0, $zero, -0x1
.L800DFE9C:
/* 7934C 800DFE9C 8CA20004 */  lw        $v0, 0x4($a1)
/* 79350 800DFEA0 30421000 */  andi      $v0, $v0, 0x1000
/* 79354 800DFEA4 10400009 */  beqz      $v0, .L800DFECC
/* 79358 800DFEA8 3C020008 */   lui      $v0, (0x80003 >> 16)
/* 7935C 800DFEAC 80A200C4 */  lb        $v0, 0xC4($a1)
/* 79360 800DFEB0 10400005 */  beqz      $v0, .L800DFEC8
/* 79364 800DFEB4 3C02FFF4 */   lui      $v0, (0xFFF40000 >> 16)
/* 79368 800DFEB8 02021021 */  addu      $v0, $s0, $v0
/* 7936C 800DFEBC 2C420003 */  sltiu     $v0, $v0, 0x3
/* 79370 800DFEC0 54400001 */  bnel      $v0, $zero, .L800DFEC8
/* 79374 800DFEC4 3C10000D */   lui      $s0, (0xD0000 >> 16)
.L800DFEC8:
/* 79378 800DFEC8 3C020008 */  lui       $v0, (0x80003 >> 16)
.L800DFECC:
/* 7937C 800DFECC 34420003 */  ori       $v0, $v0, (0x80003 & 0xFFFF)
/* 79380 800DFED0 16020006 */  bne       $s0, $v0, .L800DFEEC
/* 79384 800DFED4 0200102D */   daddu    $v0, $s0, $zero
/* 79388 800DFED8 0000202D */  daddu     $a0, $zero, $zero
/* 7938C 800DFEDC 0080282D */  daddu     $a1, $a0, $zero
/* 79390 800DFEE0 0C0B2D5B */  jal       exec_ShakeCam1
/* 79394 800DFEE4 24060002 */   addiu    $a2, $zero, 0x2
/* 79398 800DFEE8 0200102D */  daddu     $v0, $s0, $zero
.L800DFEEC:
/* 7939C 800DFEEC 8FBF0014 */  lw        $ra, 0x14($sp)
/* 793A0 800DFEF0 8FB00010 */  lw        $s0, 0x10($sp)
/* 793A4 800DFEF4 03E00008 */  jr        $ra
/* 793A8 800DFEF8 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

s32 get_overriding_player_anim(s32 anim) {
    PlayerStatus* playerStatus = &gPlayerStatus;
    PartnerStatus* partnerStatus = &gPartnerStatus;

    if (playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER
        && anim != ANIM_Mario1_Flail
        && anim != ANIM_Mario1_Jump
    ) {
        return -1;
    }

    if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE) {
        if (partnerStatus->actingPartner == PARTNER_LAKILESTER && anim == ANIM_Mario1_Idle) {
            anim = ANIM_MarioW2_RideLaki;
        }

        if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE
            && partnerStatus->actingPartner == PARTNER_BOW
            && anim != ANIM_Mario1_Crouch
            && anim != ANIM_Mario1_Idle
        ) {
            return -1;
        }
    }

    if (anim == ANIM_Mario1_ThumbsUp && partnerStatus->partnerActionState == PARTNER_ACTION_USE) {
        return -1;
    }

    if (anim == ANIM_MarioW1_Lift || anim == ANIM_Peach2_SpreadArms || anim == ANIM_Mario1_Idle) {
        if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
            if (!is_player_dismounted()) {
                return -1;
            }
        } else if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
            anim = ANIM_Peach2_SpreadArms;
        } else {
            peach_set_disguise_anim(BasicPeachDisguiseAnims[playerStatus->peachDisguise].hold);
            return -1;
        }
    } else if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
        if ((playerStatus->peachItemHeld != 0)
        && (anim == ANIM_Peach2_RaiseArms || anim == ANIM_Peach2_Talk || anim == ANIM_Peach2_LowerArms)) {
            anim = ANIM_Peach3_PresentCompleteCake;
        }
    }

    if (anim == ANIM_MarioW2_Collapse) {
        exec_ShakeCam1(0, 0, 2);
    }

    return anim;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_802431A0
/* 163A00 802431A0 27BDFFE0 */  addiu     $sp, $sp, -0x20
D_802431A4:
/* 163A04 802431A4 AFB00010 */  sw        $s0, 0x10($sp)
.L802431A8:
/* 163A08 802431A8 2410002C */  addiu     $s0, $zero, 0x2C
.L802431AC:
/* 163A0C 802431AC 2406FFFF */  addiu     $a2, $zero, -0x1
glabel func_802431B0
/* 163A10 802431B0 0200282D */  daddu     $a1, $s0, $zero
glabel func_802431B4
/* 163A14 802431B4 3C028025 */  lui       $v0, %hi(D_8024C098_C09918)
glabel func_802431B8
/* 163A18 802431B8 8042C098 */  lb        $v0, %lo(D_8024C098_C09918)($v0)
glabel .L802431BC
/* 163A1C 802431BC 3C038016 */  lui       $v1, %hi(D_8015A2D0)
.L802431C0:
/* 163A20 802431C0 2463A2D0 */  addiu     $v1, $v1, %lo(D_8015A2D0)
D_802431C4:
/* 163A24 802431C4 AFBF0018 */  sw        $ra, 0x18($sp)
D_802431C8:
/* 163A28 802431C8 AFB10014 */  sw        $s1, 0x14($sp)
D_802431CC:
/* 163A2C 802431CC 00021080 */  sll       $v0, $v0, 2
D_802431D0:
/* 163A30 802431D0 3C048025 */  lui       $a0, %hi(D_80249B84)
D_802431D4:
/* 163A34 802431D4 00822021 */  addu      $a0, $a0, $v0
/* 163A38 802431D8 8C849B84 */  lw        $a0, %lo(D_80249B84)($a0)
glabel func_802431DC
/* 163A3C 802431DC 80620003 */  lb        $v0, 0x3($v1)
glabel func_802431E0
/* 163A40 802431E0 10460003 */  beq       $v0, $a2, D_802431F0
D_802431E4:
/* 163A44 802431E4 00000000 */   nop
D_802431E8:
/* 163A48 802431E8 54450006 */  bnel      $v0, $a1, .L80243204
.L802431EC:
/* 163A4C 802431EC 26100001 */   addiu    $s0, $s0, 0x1
D_802431F0:
/* 163A50 802431F0 90620000 */  lbu       $v0, 0x0($v1)
glabel func_802431F4
/* 163A54 802431F4 30420008 */  andi      $v0, $v0, 0x8
glabel func_802431F8
/* 163A58 802431F8 14400006 */  bnez      $v0, D_80243214
D_802431FC:
/* 163A5C 802431FC 2A020040 */   slti     $v0, $s0, 0x40
D_80243200:
/* 163A60 80243200 26100001 */  addiu     $s0, $s0, 0x1
.L80243204:
/* 163A64 80243204 2A020040 */  slti      $v0, $s0, 0x40
dgb_04_pad_3208:
/* 163A68 80243208 1440FFF4 */  bnez      $v0, func_802431DC
glabel .L8024320C
/* 163A6C 8024320C 24630020 */   addiu    $v1, $v1, 0x20
D_80243210:
/* 163A70 80243210 2A020040 */  slti      $v0, $s0, 0x40
D_80243214:
/* 163A74 80243214 1440000B */  bnez      $v0, .L80243244
flo_10_pad_3218:
/* 163A78 80243218 00000000 */   nop
.L8024321C:
/* 163A7C 8024321C 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
glabel func_80243220
/* 163A80 80243220 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
glabel .L80243224
/* 163A84 80243224 8C430020 */  lw        $v1, 0x20($v0)
D_80243228:
/* 163A88 80243228 8C420010 */  lw        $v0, 0x10($v0)
.L8024322C:
/* 163A8C 8024322C 3C018025 */  lui       $at, %hi(D_8024C08C)
glabel func_80243230
/* 163A90 80243230 AC23C08C */  sw        $v1, %lo(D_8024C08C)($at)
.L80243234:
/* 163A94 80243234 3C018025 */  lui       $at, %hi(D_8024C084)
glabel func_80243238
/* 163A98 80243238 AC22C084 */  sw        $v0, %lo(D_8024C084)($at)
/* 163A9C 8024323C 08090C95 */  j         D_80243254
D_80243240:
/* 163AA0 80243240 00000000 */   nop
glabel .L80243244
/* 163AA4 80243244 3C018025 */  lui       $at, %hi(D_8024C08C)
D_80243248:
/* 163AA8 80243248 AC20C08C */  sw        $zero, %lo(D_8024C08C)($at)
glabel func_8024324C
/* 163AAC 8024324C 3C018025 */  lui       $at, %hi(D_8024C084)
D_80243250:
/* 163AB0 80243250 AC20C084 */  sw        $zero, %lo(D_8024C084)($at)
D_80243254:
/* 163AB4 80243254 3C058025 */  lui       $a1, %hi(D_8024C084)
D_80243258:
/* 163AB8 80243258 24A5C084 */  addiu     $a1, $a1, %lo(D_8024C084)
.L8024325C:
/* 163ABC 8024325C 8CA30000 */  lw        $v1, 0x0($a1)
glabel func_80243260
/* 163AC0 80243260 30624000 */  andi      $v0, $v1, 0x4000
D_80243264:
/* 163AC4 80243264 10400004 */  beqz      $v0, .L80243278
.L80243268:
/* 163AC8 80243268 3C02FFFF */   lui      $v0, (0xFFFF7FFF >> 16)
D_8024326C:
/* 163ACC 8024326C 34427FFF */  ori       $v0, $v0, (0xFFFF7FFF & 0xFFFF)
glabel func_80243270
/* 163AD0 80243270 00621024 */  and       $v0, $v1, $v0
.L80243274:
/* 163AD4 80243274 ACA20000 */  sw        $v0, 0x0($a1)
.L80243278:
/* 163AD8 80243278 3C058025 */  lui       $a1, %hi(D_8024C08C)
.L8024327C:
/* 163ADC 8024327C 24A5C08C */  addiu     $a1, $a1, %lo(D_8024C08C)
D_80243280:
/* 163AE0 80243280 8CA30000 */  lw        $v1, 0x0($a1)
D_80243284:
/* 163AE4 80243284 30624000 */  andi      $v0, $v1, 0x4000
D_80243288:
/* 163AE8 80243288 10400004 */  beqz      $v0, D_8024329C
glabel func_8024328C
/* 163AEC 8024328C 3C02FFFF */   lui      $v0, (0xFFFF7FFF >> 16)
glabel .L80243290
/* 163AF0 80243290 34427FFF */  ori       $v0, $v0, (0xFFFF7FFF & 0xFFFF)
glabel func_80243294
/* 163AF4 80243294 00621024 */  and       $v0, $v1, $v0
glabel .L80243298
/* 163AF8 80243298 ACA20000 */  sw        $v0, 0x0($a1)
D_8024329C:
/* 163AFC 8024329C 90820000 */  lbu       $v0, 0x0($a0)
.L802432A0:
/* 163B00 802432A0 10400006 */  beqz      $v0, .L802432BC
glabel .L802432A4
/* 163B04 802432A4 00000000 */   nop
glabel .L802432A8
/* 163B08 802432A8 8C820010 */  lw        $v0, 0x10($a0)
glabel func_802432AC
/* 163B0C 802432AC 10400003 */  beqz      $v0, .L802432BC
glabel func_802432B0
/* 163B10 802432B0 00000000 */   nop
glabel .L802432B4
/* 163B14 802432B4 0040F809 */  jalr      $v0
/* 163B18 802432B8 00000000 */   nop
.L802432BC:
/* 163B1C 802432BC 3C118025 */  lui       $s1, %hi(D_80249B84)
glabel func_802432C0
/* 163B20 802432C0 26319B84 */  addiu     $s1, $s1, %lo(D_80249B84)
D_802432C4:
/* 163B24 802432C4 0000802D */  daddu     $s0, $zero, $zero
glabel .L802432C8
/* 163B28 802432C8 8E240000 */  lw        $a0, 0x0($s1)
glabel .L802432CC
/* 163B2C 802432CC 90820000 */  lbu       $v0, 0x0($a0)
D_802432D0:
/* 163B30 802432D0 10400006 */  beqz      $v0, .L802432EC
D_802432D4:
/* 163B34 802432D4 26100001 */   addiu    $s0, $s0, 0x1
glabel .L802432D8
/* 163B38 802432D8 8C820014 */  lw        $v0, 0x14($a0)
glabel .L802432DC
/* 163B3C 802432DC 10400003 */  beqz      $v0, .L802432EC
D_802432E0:
/* 163B40 802432E0 00000000 */   nop
/* 163B44 802432E4 0040F809 */  jalr      $v0
D_802432E8:
/* 163B48 802432E8 00000000 */   nop
.L802432EC:
/* 163B4C 802432EC 2A020004 */  slti      $v0, $s0, 0x4
D_802432F0:
/* 163B50 802432F0 1440FFF5 */  bnez      $v0, .L802432C8
glabel .L802432F4
/* 163B54 802432F4 26310004 */   addiu    $s1, $s1, 0x4
glabel .L802432F8
/* 163B58 802432F8 8FBF0018 */  lw        $ra, 0x18($sp)
glabel func_802432FC
/* 163B5C 802432FC 8FB10014 */  lw        $s1, 0x14($sp)
D_80243300:
/* 163B60 80243300 8FB00010 */  lw        $s0, 0x10($sp)
/* 163B64 80243304 03E00008 */  jr        $ra
.L80243308:
/* 163B68 80243308 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

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

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

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

    filemenu_cursor_posX += xDelta;
    filemenu_cursor_posY += yDelta;

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

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

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

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

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

    filemenu_cursorGoalAlpha2 = 255;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel contRmbControl
/* 3AD20 8005F920 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 3AD24 8005F924 AFB20018 */  sw        $s2, 0x18($sp)
/* 3AD28 8005F928 0080902D */  daddu     $s2, $a0, $zero
/* 3AD2C 8005F92C 00A0302D */  daddu     $a2, $a1, $zero
/* 3AD30 8005F930 AFB00010 */  sw        $s0, 0x10($sp)
/* 3AD34 8005F934 AFBF0020 */  sw        $ra, 0x20($sp)
/* 3AD38 8005F938 AFB3001C */  sw        $s3, 0x1C($sp)
/* 3AD3C 8005F93C AFB10014 */  sw        $s1, 0x14($sp)
/* 3AD40 8005F940 92430006 */  lbu       $v1, 0x6($s2)
/* 3AD44 8005F944 24130002 */  addiu     $s3, $zero, 0x2
/* 3AD48 8005F948 10730069 */  beq       $v1, $s3, .L8005FAF0
/* 3AD4C 8005F94C 0000802D */   daddu    $s0, $zero, $zero
/* 3AD50 8005F950 28620003 */  slti      $v0, $v1, 0x3
/* 3AD54 8005F954 10400005 */  beqz      $v0, .L8005F96C
/* 3AD58 8005F958 24020001 */   addiu    $v0, $zero, 0x1
/* 3AD5C 8005F95C 1062000A */  beq       $v1, $v0, .L8005F988
/* 3AD60 8005F960 0200102D */   daddu    $v0, $s0, $zero
/* 3AD64 8005F964 08017EBD */  j         .L8005FAF4
/* 3AD68 8005F968 00000000 */   nop
.L8005F96C:
/* 3AD6C 8005F96C 24020003 */  addiu     $v0, $zero, 0x3
/* 3AD70 8005F970 10620018 */  beq       $v1, $v0, .L8005F9D4
/* 3AD74 8005F974 24020004 */   addiu    $v0, $zero, 0x4
/* 3AD78 8005F978 10620048 */  beq       $v1, $v0, .L8005FA9C
/* 3AD7C 8005F97C 0200102D */   daddu    $v0, $s0, $zero
/* 3AD80 8005F980 08017EBD */  j         .L8005FAF4
/* 3AD84 8005F984 00000000 */   nop
.L8005F988:
/* 3AD88 8005F988 96420004 */  lhu       $v0, 0x4($s2)
/* 3AD8C 8005F98C 1040000C */  beqz      $v0, .L8005F9C0
/* 3AD90 8005F990 00062040 */   sll      $a0, $a2, 1
/* 3AD94 8005F994 00862021 */  addu      $a0, $a0, $a2
/* 3AD98 8005F998 00042080 */  sll       $a0, $a0, 2
/* 3AD9C 8005F99C 00862021 */  addu      $a0, $a0, $a2
/* 3ADA0 8005F9A0 000420C0 */  sll       $a0, $a0, 3
/* 3ADA4 8005F9A4 3C02800E */  lui       $v0, %hi(nuContPfs)
/* 3ADA8 8005F9A8 2442AAD8 */  addiu     $v0, $v0, %lo(nuContPfs)
/* 3ADAC 8005F9AC 00822021 */  addu      $a0, $a0, $v0
/* 3ADB0 8005F9B0 0C019F80 */  jal       __osMotorAccess
/* 3ADB4 8005F9B4 0000282D */   daddu    $a1, $zero, $zero
/* 3ADB8 8005F9B8 08017E71 */  j         .L8005F9C4
/* 3ADBC 8005F9BC 0040802D */   daddu    $s0, $v0, $zero
.L8005F9C0:
/* 3ADC0 8005F9C0 A2530006 */  sb        $s3, 0x6($s2)
.L8005F9C4:
/* 3ADC4 8005F9C4 96420004 */  lhu       $v0, 0x4($s2)
/* 3ADC8 8005F9C8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3ADCC 8005F9CC 08017EBC */  j         .L8005FAF0
/* 3ADD0 8005F9D0 A6420004 */   sh       $v0, 0x4($s2)
.L8005F9D4:
/* 3ADD4 8005F9D4 96420002 */  lhu       $v0, 0x2($s2)
/* 3ADD8 8005F9D8 1040001F */  beqz      $v0, .L8005FA58
/* 3ADDC 8005F9DC 00062040 */   sll      $a0, $a2, 1
/* 3ADE0 8005F9E0 96420004 */  lhu       $v0, 0x4($s2)
/* 3ADE4 8005F9E4 96430000 */  lhu       $v1, 0x0($s2)
/* 3ADE8 8005F9E8 00431021 */  addu      $v0, $v0, $v1
/* 3ADEC 8005F9EC 304300FF */  andi      $v1, $v0, 0xFF
/* 3ADF0 8005F9F0 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 3ADF4 8005F9F4 00021202 */  srl       $v0, $v0, 8
/* 3ADF8 8005F9F8 1040000B */  beqz      $v0, .L8005FA28
/* 3ADFC 8005F9FC A6430004 */   sh       $v1, 0x4($s2)
/* 3AE00 8005FA00 00062040 */  sll       $a0, $a2, 1
/* 3AE04 8005FA04 00862021 */  addu      $a0, $a0, $a2
/* 3AE08 8005FA08 00042080 */  sll       $a0, $a0, 2
/* 3AE0C 8005FA0C 00862021 */  addu      $a0, $a0, $a2
/* 3AE10 8005FA10 000420C0 */  sll       $a0, $a0, 3
/* 3AE14 8005FA14 3C02800E */  lui       $v0, %hi(nuContPfs)
/* 3AE18 8005FA18 2442AAD8 */  addiu     $v0, $v0, %lo(nuContPfs)
/* 3AE1C 8005FA1C 00822021 */  addu      $a0, $a0, $v0
/* 3AE20 8005FA20 08017E92 */  j         .L8005FA48
/* 3AE24 8005FA24 24050001 */   addiu    $a1, $zero, 0x1
.L8005FA28:
/* 3AE28 8005FA28 00862021 */  addu      $a0, $a0, $a2
/* 3AE2C 8005FA2C 00042080 */  sll       $a0, $a0, 2
/* 3AE30 8005FA30 00862021 */  addu      $a0, $a0, $a2
/* 3AE34 8005FA34 000420C0 */  sll       $a0, $a0, 3
/* 3AE38 8005FA38 3C02800E */  lui       $v0, %hi(nuContPfs)
/* 3AE3C 8005FA3C 2442AAD8 */  addiu     $v0, $v0, %lo(nuContPfs)
/* 3AE40 8005FA40 00822021 */  addu      $a0, $a0, $v0
/* 3AE44 8005FA44 0000282D */  daddu     $a1, $zero, $zero
.L8005FA48:
/* 3AE48 8005FA48 0C019F80 */  jal       __osMotorAccess
/* 3AE4C 8005FA4C 00000000 */   nop
/* 3AE50 8005FA50 08017EA3 */  j         .L8005FA8C
/* 3AE54 8005FA54 0040802D */   daddu    $s0, $v0, $zero
.L8005FA58:
/* 3AE58 8005FA58 00862021 */  addu      $a0, $a0, $a2
/* 3AE5C 8005FA5C 00042080 */  sll       $a0, $a0, 2
/* 3AE60 8005FA60 00862021 */  addu      $a0, $a0, $a2
/* 3AE64 8005FA64 000420C0 */  sll       $a0, $a0, 3
/* 3AE68 8005FA68 3C02800E */  lui       $v0, %hi(nuContPfs)
/* 3AE6C 8005FA6C 2442AAD8 */  addiu     $v0, $v0, %lo(nuContPfs)
/* 3AE70 8005FA70 00822021 */  addu      $a0, $a0, $v0
/* 3AE74 8005FA74 0C019F80 */  jal       __osMotorAccess
/* 3AE78 8005FA78 0000282D */   daddu    $a1, $zero, $zero
/* 3AE7C 8005FA7C 0040802D */  daddu     $s0, $v0, $zero
/* 3AE80 8005FA80 24020001 */  addiu     $v0, $zero, 0x1
/* 3AE84 8005FA84 A2420006 */  sb        $v0, 0x6($s2)
/* 3AE88 8005FA88 A6530004 */  sh        $s3, 0x4($s2)
.L8005FA8C:
/* 3AE8C 8005FA8C 96420002 */  lhu       $v0, 0x2($s2)
/* 3AE90 8005FA90 2442FFFF */  addiu     $v0, $v0, -0x1
/* 3AE94 8005FA94 08017EBC */  j         .L8005FAF0
/* 3AE98 8005FA98 A6420002 */   sh       $v0, 0x2($s2)
.L8005FA9C:
/* 3AE9C 8005FA9C 3C04800E */  lui       $a0, %hi(nuSiMesgQ)
/* 3AEA0 8005FAA0 2484AC78 */  addiu     $a0, $a0, %lo(nuSiMesgQ)
/* 3AEA4 8005FAA4 00061040 */  sll       $v0, $a2, 1
/* 3AEA8 8005FAA8 00461021 */  addu      $v0, $v0, $a2
/* 3AEAC 8005FAAC 00021080 */  sll       $v0, $v0, 2
/* 3AEB0 8005FAB0 00461021 */  addu      $v0, $v0, $a2
/* 3AEB4 8005FAB4 000210C0 */  sll       $v0, $v0, 3
/* 3AEB8 8005FAB8 3C03800E */  lui       $v1, %hi(nuContPfs)
/* 3AEBC 8005FABC 2463AAD8 */  addiu     $v1, $v1, %lo(nuContPfs)
/* 3AEC0 8005FAC0 00438821 */  addu      $s1, $v0, $v1
/* 3AEC4 8005FAC4 0C019FD1 */  jal       osMotorInit
/* 3AEC8 8005FAC8 0220282D */   daddu    $a1, $s1, $zero
/* 3AECC 8005FACC 0040802D */  daddu     $s0, $v0, $zero
/* 3AED0 8005FAD0 16000005 */  bnez      $s0, .L8005FAE8
/* 3AED4 8005FAD4 24020001 */   addiu    $v0, $zero, 0x1
/* 3AED8 8005FAD8 0220202D */  daddu     $a0, $s1, $zero
/* 3AEDC 8005FADC 0C019F80 */  jal       __osMotorAccess
/* 3AEE0 8005FAE0 0000282D */   daddu    $a1, $zero, $zero
/* 3AEE4 8005FAE4 24020001 */  addiu     $v0, $zero, 0x1
.L8005FAE8:
/* 3AEE8 8005FAE8 A2420006 */  sb        $v0, 0x6($s2)
/* 3AEEC 8005FAEC A6530004 */  sh        $s3, 0x4($s2)
.L8005FAF0:
/* 3AEF0 8005FAF0 0200102D */  daddu     $v0, $s0, $zero
.L8005FAF4:
/* 3AEF4 8005FAF4 8FBF0020 */  lw        $ra, 0x20($sp)
/* 3AEF8 8005FAF8 8FB3001C */  lw        $s3, 0x1C($sp)
/* 3AEFC 8005FAFC 8FB20018 */  lw        $s2, 0x18($sp)
/* 3AF00 8005FB00 8FB10014 */  lw        $s1, 0x14($sp)
/* 3AF04 8005FB04 8FB00010 */  lw        $s0, 0x10($sp)
/* 3AF08 8005FB08 03E00008 */  jr        $ra
/* 3AF0C 8005FB0C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

s32 contRmbControl(NUContRmbCtl* rmbCtl, u32 contNo) {
    s32 ret = 0;
    u32 cnt;

    switch (rmbCtl->state) {
        case NU_CONT_RMB_STATE_STOPPED:
            break;
        case NU_CONT_RMB_STATE_STOPPING:
            if (rmbCtl->counter != 0) {
                ret = osMotorStop(&nuContPfs[contNo]);
            } else {
                rmbCtl->state = NU_CONT_RMB_STATE_STOPPED;
            }
            rmbCtl->counter--;
            break;
        case NU_CONT_RMB_STATE_RUN:
            if (rmbCtl->frame > 0) {
                rmbCtl->counter += rmbCtl->freq;
                cnt = rmbCtl->counter >> 8;
                rmbCtl->counter &= 0xFF;
                if (cnt > 0) {
                    ret = osMotorStart(&nuContPfs[contNo]);
                } else {
                    ret = osMotorStop(&nuContPfs[contNo]);
                }
            } else {
                ret = osMotorStop(&nuContPfs[contNo]);
                rmbCtl->state = NU_CONT_RMB_STATE_STOPPING;
                rmbCtl->counter = 2;
            }
            rmbCtl->frame--;
            break;
        case NU_CONT_RMB_STATE_FORCESTOP:
            ret = osMotorInit(&nuSiMesgQ, &nuContPfs[contNo], contNo);
            if (ret == 0) {
                osMotorStop(&nuContPfs[contNo]);
            }
            rmbCtl->state = NU_CONT_RMB_STATE_STOPPING;
            rmbCtl->counter = 2;
    }

    return ret;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel show_action_rating
/* 1950D0 802667F0 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 1950D4 802667F4 44860000 */  mtc1      $a2, $f0
/* 1950D8 802667F8 44871000 */  mtc1      $a3, $f2
/* 1950DC 802667FC AFB00018 */  sw        $s0, 0x18($sp)
/* 1950E0 80266800 00A0802D */  daddu     $s0, $a1, $zero
/* 1950E4 80266804 AFBF001C */  sw        $ra, 0x1C($sp)
/* 1950E8 80266808 8E020200 */  lw        $v0, 0x200($s0)
/* 1950EC 8026680C C7A40030 */  lwc1      $f4, 0x30($sp)
/* 1950F0 80266810 3C05800E */  lui       $a1, %hi(gBattleStatus + 0xD8)
/* 1950F4 80266814 8CA5C148 */  lw        $a1, %lo(gBattleStatus + 0xD8)($a1)
/* 1950F8 80266818 1440001A */  bnez      $v0, .L80266884
/* 1950FC 8026681C 0080182D */   daddu    $v1, $a0, $zero
/* 195100 80266820 2C620006 */  sltiu     $v0, $v1, 0x6
/* 195104 80266824 1040003E */  beqz      $v0, .L80266920
/* 195108 80266828 0000202D */   daddu    $a0, $zero, $zero
/* 19510C 8026682C 00031080 */  sll       $v0, $v1, 2
/* 195110 80266830 3C01802A */  lui       $at, %hi(jtbl_8029D640)
/* 195114 80266834 00220821 */  addu      $at, $at, $v0
/* 195118 80266838 8C22D640 */  lw        $v0, %lo(jtbl_8029D640)($at)
/* 19511C 8026683C 00400008 */  jr        $v0
/* 195120 80266840 00000000 */   nop
glabel .L80266844
/* 195124 80266844 0000202D */  daddu     $a0, $zero, $zero
/* 195128 80266848 24020001 */  addiu     $v0, $zero, 0x1
/* 19512C 8026684C 08099A48 */  j         .L80266920
/* 195130 80266850 A2020204 */   sb       $v0, 0x204($s0)
glabel .L80266854
/* 195134 80266854 24040004 */  addiu     $a0, $zero, 0x4
/* 195138 80266858 08099A48 */  j         .L80266920
/* 19513C 8026685C A2000204 */   sb       $zero, 0x204($s0)
glabel .L80266860
/* 195140 80266860 24040003 */  addiu     $a0, $zero, 0x3
/* 195144 80266864 08099A48 */  j         .L80266920
/* 195148 80266868 A2000204 */   sb       $zero, 0x204($s0)
glabel .L8026686C
/* 19514C 8026686C 24040002 */  addiu     $a0, $zero, 0x2
/* 195150 80266870 08099A48 */  j         .L80266920
/* 195154 80266874 A2040204 */   sb       $a0, 0x204($s0)
glabel .L80266878
/* 195158 80266878 0000202D */  daddu     $a0, $zero, $zero
/* 19515C 8026687C 08099A48 */  j         .L80266920
/* 195160 80266880 A2000204 */   sb       $zero, 0x204($s0)
.L80266884:
/* 195164 80266884 8C42000C */  lw        $v0, 0xC($v0)
/* 195168 80266888 AC400018 */  sw        $zero, 0x18($v0)
/* 19516C 8026688C 2C620006 */  sltiu     $v0, $v1, 0x6
/* 195170 80266890 82040204 */  lb        $a0, 0x204($s0)
/* 195174 80266894 10400022 */  beqz      $v0, .L80266920
/* 195178 80266898 00031080 */   sll      $v0, $v1, 2
/* 19517C 8026689C 3C01802A */  lui       $at, %hi(jtbl_8029D658)
/* 195180 802668A0 00220821 */  addu      $at, $at, $v0
/* 195184 802668A4 8C22D658 */  lw        $v0, %lo(jtbl_8029D658)($at)
/* 195188 802668A8 00400008 */  jr        $v0
/* 19518C 802668AC 00000000 */   nop
glabel .L802668B0
/* 195190 802668B0 92020204 */  lbu       $v0, 0x204($s0)
/* 195194 802668B4 24420001 */  addiu     $v0, $v0, 0x1
/* 195198 802668B8 A2020204 */  sb        $v0, 0x204($s0)
/* 19519C 802668BC 00021600 */  sll       $v0, $v0, 24
/* 1951A0 802668C0 00021603 */  sra       $v0, $v0, 24
/* 1951A4 802668C4 28420003 */  slti      $v0, $v0, 0x3
/* 1951A8 802668C8 14400015 */  bnez      $v0, .L80266920
/* 1951AC 802668CC 24020002 */   addiu    $v0, $zero, 0x2
/* 1951B0 802668D0 08099A48 */  j         .L80266920
/* 1951B4 802668D4 A2020204 */   sb       $v0, 0x204($s0)
glabel .L802668D8
/* 1951B8 802668D8 08099A48 */  j         .L80266920
/* 1951BC 802668DC 24040004 */   addiu    $a0, $zero, 0x4
glabel .L802668E0
/* 1951C0 802668E0 08099A48 */  j         .L80266920
/* 1951C4 802668E4 24040003 */   addiu    $a0, $zero, 0x3
glabel .L802668E8
/* 1951C8 802668E8 08099A48 */  j         .L80266920
/* 1951CC 802668EC 24040002 */   addiu    $a0, $zero, 0x2
glabel .L802668F0
/* 1951D0 802668F0 08099A48 */  j         .L80266920
/* 1951D4 802668F4 0000202D */   daddu    $a0, $zero, $zero
glabel .L802668F8
/* 1951D8 802668F8 90A20204 */  lbu       $v0, 0x204($a1)
/* 1951DC 802668FC 80A40204 */  lb        $a0, 0x204($a1)
/* 1951E0 80266900 24420001 */  addiu     $v0, $v0, 0x1
/* 1951E4 80266904 A0A20204 */  sb        $v0, 0x204($a1)
/* 1951E8 80266908 00021600 */  sll       $v0, $v0, 24
/* 1951EC 8026690C 00021603 */  sra       $v0, $v0, 24
/* 1951F0 80266910 28420003 */  slti      $v0, $v0, 0x3
/* 1951F4 80266914 14400002 */  bnez      $v0, .L80266920
/* 1951F8 80266918 24020002 */   addiu    $v0, $zero, 0x2
/* 1951FC 8026691C A0A20204 */  sb        $v0, 0x204($a1)
.L80266920:
/* 195200 80266920 44050000 */  mfc1      $a1, $f0
/* 195204 80266924 3C014120 */  lui       $at, (0x41200000 >> 16)
/* 195208 80266928 44810000 */  mtc1      $at, $f0
/* 19520C 8026692C 00000000 */  nop
/* 195210 80266930 46002101 */  sub.s     $f4, $f4, $f0
/* 195214 80266934 44061000 */  mfc1      $a2, $f2
/* 195218 80266938 3C014140 */  lui       $at, (0x41400000 >> 16)
/* 19521C 8026693C 44810000 */  mtc1      $at, $f0
/* 195220 80266940 44072000 */  mfc1      $a3, $f4
/* 195224 80266944 2402005A */  addiu     $v0, $zero, 0x5A
/* 195228 80266948 AFA20014 */  sw        $v0, 0x14($sp)
/* 19522C 8026694C 0C01C4E4 */  jal       fx_attack_result_text
/* 195230 80266950 E7A00010 */   swc1     $f0, 0x10($sp)
/* 195234 80266954 AE020200 */  sw        $v0, 0x200($s0)
/* 195238 80266958 24020050 */  addiu     $v0, $zero, 0x50
/* 19523C 8026695C A2020205 */  sb        $v0, 0x205($s0)
/* 195240 80266960 8FBF001C */  lw        $ra, 0x1C($sp)
/* 195244 80266964 8FB00018 */  lw        $s0, 0x18($sp)
/* 195248 80266968 03E00008 */  jr        $ra
/* 19524C 8026696C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void show_action_rating(s32 rating, Actor* actor, f32 x, f32 y, f32 z) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player;
    s32 new_var; // TODO required to match
    s32 type;

    actor->attackResultEffect = actor->attackResultEffect; // TODO required to match
    player = battleStatus->playerActor;

    if (actor->attackResultEffect == NULL) {
        type = 0;
        switch (rating) {
            case ACTION_RATING_NICE:
                type = 0;
                actor->actionRatingCombo = 1;
                break;
            case ACTION_RATING_MISS:
                type = 4;
                actor->actionRatingCombo = 0;
                break;
            case ACTION_RATING_LUCKY:
                type = 3;
                actor->actionRatingCombo = 0;
                break;
            case ACTION_RATING_SUPER:
                type = 2;
                actor->actionRatingCombo = 2;
                break;
            case ACTION_RATING_NICE_NO_COMBO:
                type = 0;
                actor->actionRatingCombo = 0;
                break;
            case ACTION_RATING_NICE_SUPER_COMBO:
                type = player->actionRatingCombo;
                player->actionRatingCombo++;
                if (player->actionRatingCombo > 2) {
                    player->actionRatingCombo = 2;
                }
                break;
        }
        actor->attackResultEffect = fx_attack_result_text(type, x, y, z - 10.0f, 12.0f, 90);
        actor->actionRatingTime = 80;
        new_var = 2; // TODO required to match
    } else {
        actor->attackResultEffect->data.attackResultText->timeLeft = 0;
        type = actor->actionRatingCombo;
        new_var = rating; // TODO required to match
        switch (new_var) { // TODO required to match
            case ACTION_RATING_NICE:
                actor->actionRatingCombo++;
                if (actor->actionRatingCombo > 2) {
                    actor->actionRatingCombo = 2;
                }
                break;
            case ACTION_RATING_MISS:
                type = 4;
                break;
            case ACTION_RATING_LUCKY:
                type = 3;
                break;
            case ACTION_RATING_SUPER:
                type = 2;
                break;
            case ACTION_RATING_NICE_NO_COMBO:
                type = 0;
                break;
            case ACTION_RATING_NICE_SUPER_COMBO:
                type = player->actionRatingCombo;
                player->actionRatingCombo++;
                if (player->actionRatingCombo > 2) {
                    player->actionRatingCombo = 2;
                }
                break;
        }
        actor->attackResultEffect = fx_attack_result_text(type, x, y, z - 10.0f, 12.0f, 90);
        actor->actionRatingTime = 80;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ResetCam
/* F1278 802CC8C8 27BDFF78 */  addiu     $sp, $sp, -0x88
/* F127C 802CC8CC AFB1005C */  sw        $s1, 0x5C($sp)
/* F1280 802CC8D0 0080882D */  daddu     $s1, $a0, $zero
/* F1284 802CC8D4 AFB20060 */  sw        $s2, 0x60($sp)
/* F1288 802CC8D8 00A0902D */  daddu     $s2, $a1, $zero
/* F128C 802CC8DC AFBF0064 */  sw        $ra, 0x64($sp)
/* F1290 802CC8E0 AFB00058 */  sw        $s0, 0x58($sp)
/* F1294 802CC8E4 F7BA0080 */  sdc1      $f26, 0x80($sp)
/* F1298 802CC8E8 F7B80078 */  sdc1      $f24, 0x78($sp)
/* F129C 802CC8EC F7B60070 */  sdc1      $f22, 0x70($sp)
/* F12A0 802CC8F0 F7B40068 */  sdc1      $f20, 0x68($sp)
/* F12A4 802CC8F4 8E30000C */  lw        $s0, 0xC($s1)
/* F12A8 802CC8F8 8E050000 */  lw        $a1, 0x0($s0)
/* F12AC 802CC8FC 0C0B1EAF */  jal       evt_get_variable
/* F12B0 802CC900 26100004 */   addiu    $s0, $s0, 0x4
/* F12B4 802CC904 0220202D */  daddu     $a0, $s1, $zero
/* F12B8 802CC908 3C06800B */  lui       $a2, %hi(gCameras)
/* F12BC 802CC90C 24C61D80 */  addiu     $a2, $a2, %lo(gCameras)
/* F12C0 802CC910 00021880 */  sll       $v1, $v0, 2
/* F12C4 802CC914 00621821 */  addu      $v1, $v1, $v0
/* F12C8 802CC918 00031880 */  sll       $v1, $v1, 2
/* F12CC 802CC91C 00621823 */  subu      $v1, $v1, $v0
/* F12D0 802CC920 000310C0 */  sll       $v0, $v1, 3
/* F12D4 802CC924 00621821 */  addu      $v1, $v1, $v0
/* F12D8 802CC928 000318C0 */  sll       $v1, $v1, 3
/* F12DC 802CC92C 8E050000 */  lw        $a1, 0x0($s0)
/* F12E0 802CC930 0C0B210B */  jal       evt_get_float_variable
/* F12E4 802CC934 00668021 */   addu     $s0, $v1, $a2
/* F12E8 802CC938 3C038011 */  lui       $v1, %hi(gPlayerStatus)
/* F12EC 802CC93C 2463EFC8 */  addiu     $v1, $v1, %lo(gPlayerStatus)
/* F12F0 802CC940 12400047 */  beqz      $s2, .L802CCA60
/* F12F4 802CC944 46000686 */   mov.s    $f26, $f0
/* F12F8 802CC948 3C0146FF */  lui       $at, (0x46FFFE00 >> 16)
/* F12FC 802CC94C 3421FE00 */  ori       $at, $at, (0x46FFFE00 & 0xFFFF)
/* F1300 802CC950 44811000 */  mtc1      $at, $f2
/* F1304 802CC954 44802000 */  mtc1      $zero, $f4
/* F1308 802CC958 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* F130C 802CC95C 44810000 */  mtc1      $at, $f0
/* F1310 802CC960 3C014120 */  lui       $at, (0x41200000 >> 16)
/* F1314 802CC964 44817000 */  mtc1      $at, $f14
/* F1318 802CC968 27A20038 */  addiu     $v0, $sp, 0x38
/* F131C 802CC96C E7A20044 */  swc1      $f2, 0x44($sp)
/* F1320 802CC970 AFA20018 */  sw        $v0, 0x18($sp)
/* F1324 802CC974 27A2003C */  addiu     $v0, $sp, 0x3C
/* F1328 802CC978 AFA2001C */  sw        $v0, 0x1C($sp)
/* F132C 802CC97C 27A20040 */  addiu     $v0, $sp, 0x40
/* F1330 802CC980 AFA20020 */  sw        $v0, 0x20($sp)
/* F1334 802CC984 27A20044 */  addiu     $v0, $sp, 0x44
/* F1338 802CC988 AFA20024 */  sw        $v0, 0x24($sp)
/* F133C 802CC98C 27A20048 */  addiu     $v0, $sp, 0x48
/* F1340 802CC990 AFA20028 */  sw        $v0, 0x28($sp)
/* F1344 802CC994 27A2004C */  addiu     $v0, $sp, 0x4C
/* F1348 802CC998 E7A00010 */  swc1      $f0, 0x10($sp)
/* F134C 802CC99C E7A40014 */  swc1      $f4, 0x14($sp)
/* F1350 802CC9A0 AFA2002C */  sw        $v0, 0x2C($sp)
/* F1354 802CC9A4 C478002C */  lwc1      $f24, 0x2C($v1)
/* F1358 802CC9A8 27A20050 */  addiu     $v0, $sp, 0x50
/* F135C 802CC9AC AFA20030 */  sw        $v0, 0x30($sp)
/* F1360 802CC9B0 C4760030 */  lwc1      $f22, 0x30($v1)
/* F1364 802CC9B4 C4740028 */  lwc1      $f20, 0x28($v1)
/* F1368 802CC9B8 44072000 */  mfc1      $a3, $f4
/* F136C 802CC9BC 460EC380 */  add.s     $f14, $f24, $f14
/* F1370 802CC9C0 4406B000 */  mfc1      $a2, $f22
/* F1374 802CC9C4 0C017449 */  jal       test_ray_zones
/* F1378 802CC9C8 4600A306 */   mov.s    $f12, $f20
/* F137C 802CC9CC 0040182D */  daddu     $v1, $v0, $zero
/* F1380 802CC9D0 0460001A */  bltz      $v1, .L802CCA3C
/* F1384 802CC9D4 000310C0 */   sll      $v0, $v1, 3
/* F1388 802CC9D8 00431023 */  subu      $v0, $v0, $v1
/* F138C 802CC9DC 3C03800E */  lui       $v1, %hi(D_800D91D4)
/* F1390 802CC9E0 8C6391D4 */  lw        $v1, %lo(D_800D91D4)($v1)
/* F1394 802CC9E4 00021080 */  sll       $v0, $v0, 2
/* F1398 802CC9E8 00431021 */  addu      $v0, $v0, $v1
/* F139C 802CC9EC 8C420010 */  lw        $v0, 0x10($v0)
/* F13A0 802CC9F0 260304D8 */  addiu     $v1, $s0, 0x4D8
/* F13A4 802CC9F4 24440020 */  addiu     $a0, $v0, 0x20
.L802CC9F8:
/* F13A8 802CC9F8 8C480000 */  lw        $t0, 0x0($v0)
/* F13AC 802CC9FC 8C490004 */  lw        $t1, 0x4($v0)
/* F13B0 802CCA00 8C4A0008 */  lw        $t2, 0x8($v0)
/* F13B4 802CCA04 8C4B000C */  lw        $t3, 0xC($v0)
/* F13B8 802CCA08 AC680000 */  sw        $t0, 0x0($v1)
/* F13BC 802CCA0C AC690004 */  sw        $t1, 0x4($v1)
/* F13C0 802CCA10 AC6A0008 */  sw        $t2, 0x8($v1)
/* F13C4 802CCA14 AC6B000C */  sw        $t3, 0xC($v1)
/* F13C8 802CCA18 24420010 */  addiu     $v0, $v0, 0x10
/* F13CC 802CCA1C 1444FFF6 */  bne       $v0, $a0, .L802CC9F8
/* F13D0 802CCA20 24630010 */   addiu    $v1, $v1, 0x10
/* F13D4 802CCA24 8C480000 */  lw        $t0, 0x0($v0)
/* F13D8 802CCA28 8C490004 */  lw        $t1, 0x4($v0)
/* F13DC 802CCA2C 8C4A0008 */  lw        $t2, 0x8($v0)
/* F13E0 802CCA30 AC680000 */  sw        $t0, 0x0($v1)
/* F13E4 802CCA34 AC690004 */  sw        $t1, 0x4($v1)
/* F13E8 802CCA38 AC6A0008 */  sw        $t2, 0x8($v1)
.L802CCA3C:
/* F13EC 802CCA3C 0000102D */  daddu     $v0, $zero, $zero
/* F13F0 802CCA40 24030001 */  addiu     $v1, $zero, 0x1
/* F13F4 802CCA44 E61404B0 */  swc1      $f20, 0x4B0($s0)
/* F13F8 802CCA48 E61804B4 */  swc1      $f24, 0x4B4($s0)
/* F13FC 802CCA4C E61604B8 */  swc1      $f22, 0x4B8($s0)
/* F1400 802CCA50 E61A0490 */  swc1      $f26, 0x490($s0)
/* F1404 802CCA54 A6030506 */  sh        $v1, 0x506($s0)
/* F1408 802CCA58 080B32A5 */  j         .L802CCA94
/* F140C 802CCA5C A6030504 */   sh       $v1, 0x504($s0)
.L802CCA60:
/* F1410 802CCA60 C6000484 */  lwc1      $f0, 0x484($s0)
/* F1414 802CCA64 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* F1418 802CCA68 44811000 */  mtc1      $at, $f2
/* F141C 802CCA6C 00000000 */  nop
/* F1420 802CCA70 4600103E */  c.le.s    $f2, $f0
/* F1424 802CCA74 00000000 */  nop
/* F1428 802CCA78 45000007 */  bc1f      .L802CCA98
/* F142C 802CCA7C 0000102D */   daddu    $v0, $zero, $zero
/* F1430 802CCA80 24020002 */  addiu     $v0, $zero, 0x2
/* F1434 802CCA84 24030001 */  addiu     $v1, $zero, 0x1
/* F1438 802CCA88 A6030506 */  sh        $v1, 0x506($s0)
/* F143C 802CCA8C A6000504 */  sh        $zero, 0x504($s0)
/* F1440 802CCA90 E6020490 */  swc1      $f2, 0x490($s0)
.L802CCA94:
/* F1444 802CCA94 AE000508 */  sw        $zero, 0x508($s0)
.L802CCA98:
/* F1448 802CCA98 8FBF0064 */  lw        $ra, 0x64($sp)
/* F144C 802CCA9C 8FB20060 */  lw        $s2, 0x60($sp)
/* F1450 802CCAA0 8FB1005C */  lw        $s1, 0x5C($sp)
/* F1454 802CCAA4 8FB00058 */  lw        $s0, 0x58($sp)
/* F1458 802CCAA8 D7BA0080 */  ldc1      $f26, 0x80($sp)
/* F145C 802CCAAC D7B80078 */  ldc1      $f24, 0x78($sp)
/* F1460 802CCAB0 D7B60070 */  ldc1      $f22, 0x70($sp)
/* F1464 802CCAB4 D7B40068 */  ldc1      $f20, 0x68($sp)
/* F1468 802CCAB8 03E00008 */  jr        $ra
/* F146C 802CCABC 27BD0088 */   addiu    $sp, $sp, 0x88

### DECOMPILED C INSTRUCTIONS:

ApiStatus ResetCam(Evt* script, s32 isInitialCall) {
    Bytecode* args = script->ptrReadPos;
    s32 id = evt_get_variable(script, *args++);
    Camera* camera = &gCameras[id];
    f32 moveSpeed = evt_get_float_variable(script, *args++);
    PlayerStatus* playerStatus = &gPlayerStatus;

    if (isInitialCall) {
        f32 x = playerStatus->position.x;
        f32 y = playerStatus->position.y;
        f32 z = playerStatus->position.z;
        f32 hitX, hitY, hitZ;
        f32 hitDepth = 32767.0f;
        f32 nx, ny, nz;
        s32 hitID;

        hitID = test_ray_zones(x, y + 10.0f, z, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth,
                               &nx, &ny, &nz);

        if (hitID >= 0) {
            camera->controlSettings = *gZoneCollisionData.colliderList[hitID].camSettings;
        }

        camera->movePos.x = x;
        camera->movePos.y = y;
        camera->movePos.z = z;
        camera->moveSpeed = moveSpeed;
        camera->panActive = TRUE;
        camera->followPlayer = TRUE;
        camera->panPhase = 0.0f;
        return ApiStatus_BLOCK;
    }

    if (camera->interpAlpha >= 1.0f) {
        camera->panActive = TRUE;
        camera->followPlayer = FALSE;
        camera->moveSpeed = 1.0f;
        camera->panPhase = 0.0f;
        return ApiStatus_DONE2;
    }

    return ApiStatus_BLOCK;
}