#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA067_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
#ifndef NOCOPYPROTECTION
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
overlay "player"

BOOLEAN F0356_CPSE_IsFuzzySectorValid_ByteValuesAndFuzzyBitCount(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0720_pc_SectorBuffer)
#endif
REGISTER char*    P0720_pc_SectorBuffer FINAL_SEPARATOR
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
BOOLEAN F0356_CPSE_IsFuzzySectorValid_ByteValuesAndFuzzyBitCount(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0720_pi_SectorBuffer)
#endif
REGISTER int16_t* P0720_pi_SectorBuffer FINAL_SEPARATOR
#endif
{
        REGISTER int16_t L1104_i_ByteIndex;
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        REGISTER unsigned int16_t L1105_ui_Byte;
#endif
        REGISTER int16_t L1106_i_FuzzyBitCount;
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
        REGISTER unsigned int16_t L1105_ui_Byte;
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        static int16_t G0628_i_LastFuzzyBitCount_CPSE;
        static int16_t G0629_i_ConsecutiveIdenticalFuzzyBitCounts_CPSE;
#endif


        L1106_i_FuzzyBitCount = 0;
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1104_i_ByteIndex = 20;
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
        L1104_i_ByteIndex = 635;
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        P0720_pc_SectorBuffer += L1104_i_ByteIndex;
        while (L1104_i_ByteIndex++ < 509) {
                if (((L1105_ui_Byte = *P0720_pc_SectorBuffer++) & 0x007F) != 0x0068) {
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
        P0720_pi_SectorBuffer += L1104_i_ByteIndex;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        while (L1104_i_ByteIndex++ <= 508) {
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
        while (L1104_i_ByteIndex++ <= 1123) {
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
                if (((L1105_ui_Byte = *P0720_pi_SectorBuffer++) & 0x1555) != 0x1440) { /* 0x68 */
#endif
                        T0356002:
                        G0189_i_Graphic558_StopAddingEvents_CPSE = C65152_TRUE;
                        return C0_FALSE;
                }
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                if (L1105_ui_Byte == 0x00E8) {
                        L1106_i_FuzzyBitCount++;
                }
#endif
        }
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        if (L1106_i_FuzzyBitCount == G0628_i_LastFuzzyBitCount_CPSE) {
                if (++G0629_i_ConsecutiveIdenticalFuzzyBitCounts_CPSE > 3) {
                        goto T0356002;
                }
        }
        G0629_i_ConsecutiveIdenticalFuzzyBitCounts_CPSE = 0;
        G0628_i_LastFuzzyBitCount_CPSE = L1106_i_FuzzyBitCount;
#endif
        G0488_i_Graphic560_RequestCheckFuzzyBitCount_CPSE = C12777_FALSE;
        return C1_TRUE;
}
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "player"

int16_t G3957_i_CPSX;
int16_t G3956_i_CPSX;

BOOLEAN F0356_CPSE_IsFuzzySectorValid_ByteValuesAndFuzzyBitCount(
P0720_pc_SectorBuffer)
REGISTER unsigned char* P0720_pc_SectorBuffer FINAL_SEPARATOR
{
        unsigned int16_t L6225_;
        int16_t L6226_;
        int16_t L6227_;


        L6226_ = 0;
        L6227_ = 0;
        for (L6225_ = 13; L6225_ < 703; L6225_ += 2) {
                if ((P0720_pc_SectorBuffer[L6225_] ^ G0293_ai_FuzzyBits_CPSE[L6226_++]) & 0x1B) {
                        L6227_++;
                }
        }
        if (L6227_ == G3957_i_CPSX) {
                if (++G3956_i_CPSX > 3) {
                        G0189_i_Graphic558_StopAddingEvents_CPSE = C65152_TRUE;
                        return C0_FALSE;
                }
        }
        G3956_i_CPSX = 0;
        G3957_i_CPSX = L6227_;
        G0488_i_Graphic560_RequestCheckFuzzyBitCount_CPSE = C12777_FALSE;
        return C1_TRUE;
}
#endif
#ifdef MEDIA458_P20JA_P20JB
int16_t G3040_i_CPSX = 0;


BOOLEAN F0356_CPSE_IsFuzzySectorValid_ByteValuesAndFuzzyBitCount(
REGISTER char* P0720_pc_SectorBuffer FINAL_SEPARATOR
{
        G3040_i_CPSX = 0;
        if ((P0720_pc_SectorBuffer[0] != 'H') || (P0720_pc_SectorBuffer[1] != 'P') || (P0720_pc_SectorBuffer[2] != 'R') || (P0720_pc_SectorBuffer[3] != '-') || (P0720_pc_SectorBuffer[4] != '0') || (P0720_pc_SectorBuffer[5] != '0') || (P0720_pc_SectorBuffer[6] != '0') || (P0720_pc_SectorBuffer[7] != '7')) {
                G3040_i_CPSX++;
        } else {
                G3040_i_CPSX = 0;
        }
        if (G3040_i_CPSX > 1) { /* Never executed because G3040_i_CPSX is either 0 or 1 */
                G0189_i_Graphic558_StopAddingEvents_CPSE = C65152_TRUE;
                return C0_FALSE;
        } else {
                G0488_i_Graphic560_RequestCheckFuzzyBitCount_CPSE = C12777_FALSE;
                return C1_TRUE;
        }
}
#endif
#ifdef MEDIA607_X30J_X31J
BOOLEAN F0356_CPSE_IsFuzzySectorValid_ByteValuesAndFuzzyBitCount(
REGISTER int16_t* P0720_pi_SectorBuffer FINAL_SEPARATOR
{
        G0488_i_Graphic560_RequestCheckFuzzyBitCount_CPSE = C12777_FALSE;
        return C1_TRUE;
}
#endif

#endif
#endif
