#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA772_SU1E
extern void F1899_Pre_F1901_CopyProtectionRoutine_CPSX();
extern void F1902_Post_F1901_CopyProtectionRoutine_CPSX();
extern void F1873_Pre_F1875_FreeHintGraphics_CPSX();
extern void F1876_Post_F1875_FreeHintGraphics_CPSX();


long G3542_l_Unreferenced;
int16_t G3576_i_Unused;
#ifndef NOCOPYPROTECTION
char G3720_CPSX[8];             /* Start of array / structure referenced from G3720_CPSX in F1372_SetVerticalBlankInterrupt */
int16_t (*G3700_CPSX)();
char* G3701_CPSX;
char* G3703_CPSX;
char* G3704_CPSX;
int16_t G3702_CPSX;
int16_t G3735_i_Unreferenced;
int16_t G3705_CPSX;
char G3736_ac_Unreferenced[10]; /* End of structure */


void F1985_CPSX(int16_t P5890_, int16_t P5891_) {
        int16_t L5727_;
        int16_t L5728_;
        int16_t L5733_;


        asm {
                        move.l  F1899_Pre_F1901_CopyProtectionRoutine_CPSX+2(a5),G3700_CPSX(a5)
                        move.l  F1902_Post_F1901_CopyProtectionRoutine_CPSX+2(a5),G3701_CPSX(a5)
                @Tloc_AF16:
                        move.w  P5891_(a6),d0
                        move.w  #0x635F,d1
                        bra.s   @Tloc_AF26
                        asl.w   #1,d0
                        add.w   d0,d1
                        bra.s   @Tloc_AF28
                @Tloc_AF26:
                        moveq   #0,d0
                @Tloc_AF28:
                        cmp.w   d0,d1
                        bcc.s   @Tloc_AF34
                        move.w  L5727_(a6),d1
                        add.w   d0,d1
                        asl.w   #1,d1
                @Tloc_AF34:
                        lea     @Tloc_AF16,a0
                        move.w  6(a0),L5727_(a6) /* Checksum value 0x635F */
        }
        G3702_CPSX = L5727_;
        asm {
                        move.l  F1873_Pre_F1875_FreeHintGraphics_CPSX+2(a5),G3703_CPSX(a5)
                        move.l  F1876_Post_F1875_FreeHintGraphics_CPSX+2(a5),G3704_CPSX(a5)
                @Tloc_AF50:
                        move.w  L5728_(a6),d1
                        cmpi.w  #0x4663,d1
                        bcc.s   @Tloc_AF5E
                        moveq   #1,d0
                        bra.s   @Tloc_AF60
                @Tloc_AF5E:
                        moveq   #0,d0
                @Tloc_AF60:
                        move.w  -10(a6),d1
                        cmp.w   d0,d1
                        bcc.s   @Tloc_AF6C
                        moveq   #1,d0
                        bra.s   @Tloc_AF6E
                @Tloc_AF6C:
                        moveq   #0,d0
                @Tloc_AF6E:
                        lea     @Tloc_AF50,a0
                        move.w  6(a0),L5727_(a6) /* Checksum value 0x4663 */
        }
        G3705_CPSX = L5727_;
}
#endif
#endif
