#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA044_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J_SU1E_AU1E_AU2E
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
overlay "memory"
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "gsthings"
#endif

void F0466_EXPAND_GraphicToBitmap(
#ifdef MEDIA087_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_SU1E
#ifndef THINK_C
P0871_puc_Graphic, P0872_puc_Bitmap, P0873_i_X, P0874_i_Y)
#endif
#endif
unsigned char* P0871_puc_Graphic SEPARATOR
#ifdef MEDIA087_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_SU1E
unsigned char* P0872_puc_Bitmap  SEPARATOR
int16_t        P0873_i_X         SEPARATOR
int16_t        P0874_i_Y         FINAL_SEPARATOR
#endif
#ifdef MEDIA530_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J_AU1E_AU2E_AU2F_AU2G_AU3E
#if (defined(MEDIA508_F20E_F20J_X30J_P20JA_P20JB) || defined(MEDIA763_AU1E_AU2E) || (defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA671_F31E_F31J_P31J) && (EXETYPE == C06_CEDT)))
unsigned char* P0872_puc_Bitmap  SEPARATOR
int16_t        P0873_i_X         SEPARATOR
int16_t        P0874_i_Y         FINAL_SEPARATOR
#else
unsigned char* P0872_puc_Bitmap  FINAL_SEPARATOR
#endif
#endif
{
#ifdef MEDIA174_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_SU1E
        asm {
                        movem.l D4-D7/A2-A6,-(A7)
                        movea.l P0871_puc_Graphic(A6),A0
                        movea.l P0872_puc_Bitmap(A6),A1
                        move.w  P0873_i_X(A6),D5
                        move.w  P0874_i_Y(A6),D4
                        move.w  (A0)+,D7                        /* Bitmap width in pixels */
                        move.w  (A0)+,D6                        /* Bitmap height in pixels */
                        add.w   #0x000F,D7
                        lsr.w   #1,D7
                        and.w   #0xFFF8,D7                      /* Byte width (after normalization to make sure the width is a multiple of 16 pixels = 8 bytes = 1 unit) */
                        cmpa.l  #0,A1
                        bne.s   @T46601                         /* Branch if bitmap address is not null else expand directly to the physical screen memory. In the game this condition is always true as the function is always called with a non null value for P0872_puc_Bitmap */
                        move.l  A0,-(A7)                        /* Backup A0 to the stack */
                        move.w  #2,-(A7)                        /* XBIOS function $02: void *Physbase(void); Returns the physical start address of the video memory */
                        trap    #14
                        addq.l  #2,A7
                        movea.l D0,A1                           /* A1 = Address of physical video memory */
                        movea.l (A7)+,A0                        /* Restore A0 from the stack */
                        move.w  #C160_BYTE_WIDTH_SCREEN,D0
                        cmp.w   D0,D7
                        beq.s   @T46601                         /* Branch if normalized bitmap width in bytes = 160 bytes = 320 pixels */
                        lsr.w   #1,D5                           /* Convert destination X in pixels to destination X in bytes */
                        and.w   #0xFFF8,D5                      /* Convert destination X in bytes to destination X in number of units (16 pixels = 8 bytes) */
                        adda.w  D5,A1
                        mulu.w  D0,D4
                        adda.w  D4,A1                           /* Address of first word to modify at X, Y in bitmap */
                        movea.l A1,A3
                        adda.w  D7,A3
                        subq.w  #1,D6
                        mulu.w  D0,D6
                        add.l   A3,D6                           /* Address of the first word after the last word of bitmap data */
                        move.w  D0,D4                           /* D4 = 160. Screen size in bytes */
                        sub.w   D7,D4
                        move.w  D4,D7
                        swap    D7                              /* Most significant word in D7 = screen size in bytes - bitmap width in bytes */
                        move.w  D0,D7                           /* Least significant word in D7 = 160 */
                        bra.s   @T46602
                @T46601:
                        mulu.w  D7,D6                           /* D6 = bitmap size in bytes */
                        movea.l A1,A3                           /* Address of bitmap */
                        adda.l  D6,A3
                        move.l  A3,D6                           /* Address of the first word after the last word of bitmap data */
                @T46602:
                        clr.l   (A1)                            /* Clear the first bitmap unit to prepare the first draw operation */
                        clr.l   4(A1)
                        moveq   #0x0F,D0                        /* Index of the first pixel left to draw in current bitmap unit */
                        moveq   #0,D4
                        lea     @V46600_Masks1(PC),A4
                        lea     @V46601_Masks2(PC),A5
                        lea     @V46602_BitmapUnits(PC),A6
                @T46603_ProcessBitmapCommand:
                        move.b  (A0)+,D3
                        move.b  D3,D2
                        bmi.s   @T46608_MultiByteCommand
                        lsr.b   #4,D3
                        beq.s   @T46612
                        and.w   #0x000F,D2
                        moveq   #1,D1
                        add.b   D3,D1
                @T46604:
                        lsl.w   #3,D2
                        movea.l A6,A2
                        adda.w  D2,A2
                @T46605:
                        bsr.s   @T46613_Subroutine_DrawPixelsInCurrentUnit
                        tst.w   D1
                        beq.s   @T46603_ProcessBitmapCommand
                        cmpi.w  #16,D1
                        bcs.s   @T46605
                        move.l  (A2),D3
                        move.l  4(A2),D5
                        subi.w  #16,D1
                @T46606:
                        move.l  D3,(A1)+
                        move.l  D5,(A1)+
                        cmpa.l  A1,A3
                        bne.s   @T46607
                        bsr.w   @T46618_Subroutine
                @T46607:
                        subi.w  #16,D1
                        bcc.s   @T46606
                        clr.l   (A1)
                        clr.l   4(A1)
                        addi.w  #16,D1
                        bne.s   @T46605
                        bra.s   @T46603_ProcessBitmapCommand
                @T46608_MultiByteCommand:
                        andi.w  #0x000F,D2
                        moveq   #0,D1
                        move.b  (A0)+,D1
                        btst    #6,D3
                        beq.s   @T46609_TwoBytesCommand
                        asl.w   #8,D1
                        move.b  (A0)+,D1
                @T46609_TwoBytesCommand:
                        addq.w  #1,D1
                        btst    #4,D3
                        beq.s   @T46604
                        btst    #5,D3
                        beq.w   @T46620
                        movea.l A1,A2
                        suba.w  D7,A2
                @T46610_LoopCopy:
                        bsr.s   @T46613_Subroutine_DrawPixelsInCurrentUnit
                        tst.l   D5
                        beq.s   @T46611
                        movea.l D5,A2
                @T46611:
                        addq.l  #8,A2
                        tst.w   D1
                        bne.s   @T46610_LoopCopy
                @T46612:
                        bsr.w   @T46622_Subroutine_DrawSinglePixel
                        bra.w   @T46603_ProcessBitmapCommand
                @T46613_Subroutine_DrawPixelsInCurrentUnit:     /* Subroutine to draw pixels in the current bitmap unit */
                        move.b  D0,D4
                        add.w   D4,D4
                        add.w   D4,D4
                        move.l  0(A4,D4.w),D3
                        cmp.l   D1,D0
                        bmi.s   @T46614_UnitFull
                        sub.w   D1,D0
                        move.b  D0,D4
                        add.w   D4,D4
                        add.w   D4,D4
                        and.l   0(A5,D4.w),D3
                        moveq   #0,D1
                        bra.s   @T46615_DrawMultiplePixels
                @T46614_UnitFull:
                        sub.w   D0,D1
                        subq.w  #1,D1
                        moveq   #-1,D0
                @T46615_DrawMultiplePixels:
                        move.l  (A2),D5
                        and.l   D3,D5
                        or.l    D5,(A1)+
                        move.l  4(A2),D5
                        and.l   D3,D5
                        or.l    D5,(A1)+
                        moveq   #0,D5
                        tst.w   D0
                        bmi.s   @T46617
                        subq.l  #8,A1
                        rts
                @T46616:
                        addq.l  #8,A1
                @T46617:
                        cmpa.l  A1,A3
                        bne.s   @T46619_ClearUnit
                @T46618_Subroutine:
                        cmp.l   A1,D6
                        beq.w   @T46642                         /* If end of bitmap has been reached (bitmap is fully expanded) */
                        adda.w  D7,A3
                        swap    D7
                        adda.w  D7,A1
                        move.l  A2,D5
                        add.w   D7,D5                           /* BUG0_01 Coding error without consequence. The 16 bit value in D7 is added to D5 (which contains an address) without extending the value to 32 bit. The resulting address may be incorrect if there is a carry. No consequence as this portion of code is never executed in the game because A3 is always equal to D6 for conditions at @T46617 and @T46618_Subroutine */
                        swap    D7
                @T46619_ClearUnit:
                        moveq   #15,D0
                        clr.l   (A1)
                        clr.l   4(A1)
                        rts
                @T46620:
                        lsr.w   #1,D1
                        bcc.s   @T46621
                        bsr.s   @T46622_Subroutine_DrawSinglePixel
                @T46621:
                        move.b  (A0),D2
                        lsr.b   #4,D2
                        bsr.s   @T46622_Subroutine_DrawSinglePixel
                        move.b  (A0)+,D2
                        bsr.s   @T46622_Subroutine_DrawSinglePixel
                        subq.w  #1,D1
                        bne.s   @T46621
                        bra.w   @T46603_ProcessBitmapCommand
                @T46622_Subroutine_DrawSinglePixel:             /* Subroutine to draw one pixel whose 4 bit color index is stored in D2. The pixel index in the unit is stored in D0 */
                        clr.w   D3
                        bset    D0,D3                           /* D3 is a mask with only one bit set */
                        andi.w  #0x000F,D2                      /* D2 value is 0 to 15 (color index) */
                        add.w   D2,D2                           /* Each entry in jumptable below is 2 bytes large */
                        jmp     2(PC,D2.w)                      /* Base address is @T46623 */
                @T46623:
                        bra.s   @T46627
                        bra.s   @T46626
                        bra.s   @T46632
                        bra.s   @T46625
                        bra.s   @T46634
                        bra.s   @T46629
                        bra.s   @T46631
                        bra.s   @T46624
                        bra.s   @T46637
                        bra.s   @T46636
                        bra.s   @T46638
                        bra.s   @T46635
                        bra.s   @T46633
                        bra.s   @T46628
                        bra.s   @T46630
                        or.w    D3,6(A1)
                @T46624:
                        or.w    D3,4(A1)
                @T46625:
                        or.w    D3,2(A1)
                @T46626:
                        or.w    D3,(A1)
                @T46627:
                        subq.w  #1,D0
                        bmi     @T46616
                        rts
                @T46628:
                        or.w    D3,6(A1)
                @T46629:
                        or.w    D3,4(A1)
                        or.w    D3,(A1)
                        subq.w  #1,D0
                        bmi.w   @T46616
                        rts
                @T46630:
                        or.w    D3,6(A1)
                @T46631:
                        or.w    D3,4(A1)
                @T46632:
                        or.w    D3,2(A1)
                        subq.w  #1,D0
                        bmi.w   @T46616
                        rts
                @T46633:
                        or.w    D3,6(A1)
                @T46634:
                        or.w    D3,4(A1)
                        subq.w  #1,D0
                        bmi.w   @T46616
                        rts
                @T46635:
                        or.w    D3,2(A1)
                @T46636:
                        or.w    D3,(A1)
                @T46637:
                        or.w    D3,6(A1)
                        subq.w  #1,D0
                        bmi.w   @T46616
                        rts
                @T46638:
                        or.w    D3,6(A1)
                        or.w    D3,2(A1)
                        subq.w  #1,D0
                        bmi.w   @T46616
                        rts
                @V46600_Masks1:                                 /* Two tables of 16 long binary masks. One mask from each table may be combined with AND to form the mask of bits to manipulate in a bitmap unit. Actually the values in these tables are longs but using dc.l produces wrong code because of a bug in the Megamax C compiler */
                        dc.w    0x0001,0x0001,0x0003,0x0003
                        dc.w    0x0007,0x0007,0x000F,0x000F
                        dc.w    0x001F,0x001F,0x003F,0x003F
                        dc.w    0x007F,0x007F,0x00FF,0x00FF
                        dc.w    0x01FF,0x01FF,0x03FF,0x03FF
                        dc.w    0x07FF,0x07FF,0x0FFF,0x0FFF
                        dc.w    0x1FFF,0x1FFF,0x3FFF,0x3FFF
                        dc.w    0x7FFF,0x7FFF,0xFFFF,0xFFFF
                @V46601_Masks2:
                        dc.w    0xFFFE,0xFFFE,0xFFFC,0xFFFC
                        dc.w    0xFFF8,0xFFF8,0xFFF0,0xFFF0
                        dc.w    0xFFE0,0xFFE0,0xFFC0,0xFFC0
                        dc.w    0xFF80,0xFF80,0xFF00,0xFF00
                        dc.w    0xFE00,0xFE00,0xFC00,0xFC00
                        dc.w    0xF800,0xF800,0xF000,0xF000
                        dc.w    0xE000,0xE000,0xC000,0xC000
                        dc.w    0x8000,0x8000,0x0000,0x0000
                @V46602_BitmapUnits:                            /* For each color index 0 to 15, a bitmap unit (4 words, 8 bytes, 16 pixels) where all pixels have the corresponding colox index. These bitmap units are used as a source of pixel data when drawing multiple pixels of the same color */
                        dc.w    0x0000,0x0000,0x0000,0x0000
                        dc.w    0xFFFF,0x0000,0x0000,0x0000
                        dc.w    0x0000,0xFFFF,0x0000,0x0000
                        dc.w    0xFFFF,0xFFFF,0x0000,0x0000
                        dc.w    0x0000,0x0000,0xFFFF,0x0000
                        dc.w    0xFFFF,0x0000,0xFFFF,0x0000
                        dc.w    0x0000,0xFFFF,0xFFFF,0x0000
                        dc.w    0xFFFF,0xFFFF,0xFFFF,0x0000
                        dc.w    0x0000,0x0000,0x0000,0xFFFF
                        dc.w    0xFFFF,0x0000,0x0000,0xFFFF
                        dc.w    0x0000,0xFFFF,0x0000,0xFFFF
                        dc.w    0xFFFF,0xFFFF,0x0000,0xFFFF
                        dc.w    0x0000,0x0000,0xFFFF,0xFFFF
                        dc.w    0xFFFF,0x0000,0xFFFF,0xFFFF
                        dc.w    0x0000,0xFFFF,0xFFFF,0xFFFF
                        dc.w    0xFFFF,0xFFFF,0xFFFF,0xFFFF
                @T46642:
                        addq.l  #4,A7
                        movem.l (A7)+,D4-D7/A2-A6
        }
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
        unsigned int16_t L6265_;
        unsigned int16_t L6268_;
        unsigned int16_t L6266_;
        int16_t L6271_;
        BOOLEAN L6264_;
        int16_t L6269_;
        char L6280_;
        char L6281_;
        char L6278_;
        char L6279_;
        int16_t L6267_;
        char* L6277_;
        int16_t L6273_[4];
        char L6276_;
        char L6270_;


        if (P0872_puc_Bitmap == NULL) {
                L6264_ = C1_TRUE;
                P0872_puc_Bitmap = G3979_puc_;
        } else {
                L6264_ = C0_FALSE;
        }
        L6265_ = *((int16_t*)P0871_puc_Graphic);
        P0871_puc_Graphic += 2;
        L6266_ = L6265_;
        L6267_ = L6265_ / 2;
        L6268_ = *((int16_t*)P0871_puc_Graphic);
        P0871_puc_Graphic++;
        L6271_ = L6268_;
        L6269_ = L6265_ * L6268_;
        asm {
                        SEP        #0x30
                        STZ        L6270_
                L080074:
                        REP        #0x30
                        INC        P0871_puc_Graphic
                        BNE        L08007C
                        INC        P0871_puc_Graphic+2
                L08007C:
                        SEP        #0x30
                        LDA        [P0871_puc_Graphic]
                        BMI        L0800C4
                        PHA
                        AND        #0x0f
                        STA        L6276_
                        PLA
                        AND        #0x70
                        TAX
                        LDA        >G3978_auc_FlippedPixels,X
                        TAY
                L080090:
                        BIT        L6270_
                        BMI        L08009E
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        BRA        L0800AE
                L08009E:
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L0800AE
                        INC        P0872_puc_Bitmap+1
                        BNE        L0800AE
                        INC        P0872_puc_Bitmap+2
                L0800AE:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BNE        L0800BF
                        BRL        L0803AC
                L0800BF:
                        DEY
                        BPL        L080090
                        BRA        L080074
                L0800C4:
                        PHA
                        BIT        #0x40
                        PHP
                        REP        #0x30
                        INC        P0871_puc_Graphic
                        BNE        L0800D0
                        INC        P0871_puc_Graphic+2
                L0800D0:
                        SEP        #0x30
                        LDA        [P0871_puc_Graphic]
                        STA        L6279_
                        STZ        L6278_
                        PLP
                        BEQ        L0800EB
                        STA        L6278_
                        REP        #0x30
                        INC        P0871_puc_Graphic
                        BNE        L0800E5
                        INC        P0871_puc_Graphic+2
                L0800E5:
                        SEP        #0x30
                        LDA        [P0871_puc_Graphic]
                        STA        L6279_
                L0800EB:
                        REP        #0x30
                        INC        L6279_
                        SEP        #0x30
                        PLA
                        PHA
                        AND        #0x30
                        BEQ        L080109
                        CMP        #0x10
                        BNE        L0800FE
                        BRL        L0801AE
                L0800FE:
                        CMP        #0x30
                        BNE        L080105
                        BRL        L0802D3
                L080105:
                        PLA
                        BRL        L080074
                L080109:
                        PLA
                        AND        #0x0f
                        STA        L6276_
                        TAX
                        LDA        >G3978_auc_FlippedPixels,X
                        ORA        L6276_
                        STA        L6281_
                        STA        L6280_
                        BIT        L6270_
                        BPL        L08013E
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L08012D
                        INC        P0872_puc_Bitmap+1
                        BNE        L08012D
                        INC        P0872_puc_Bitmap+2
                L08012D:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        BNE        L08013C
                        BRL        L0803AC
                L08013C:
                        DEC        L6279_
                L08013E:
                        REP        #0x30
                        STZ        L6265_
                        LDA        L6279_
                        LSR        A
                        ROR        L6265_
                        LSR        A
                        ROR        L6265_
                        CMP        #0x00
                        BEQ        L080166
                        TAX
                        LDA        L6281_
                        LDY        #0x00
                L080155:
                        STA        [P0872_puc_Bitmap],Y
                        INY
                        INY
                        DEX
                        BNE        L080155
                        CLC
                        TYA
                        ADC        P0872_puc_Bitmap
                        STA        P0872_puc_Bitmap
                        BCC        L080166
                        INC        P0872_puc_Bitmap+2
                L080166:
                        SEP        #0x30
                        BIT        L6265_+1
                        BPL        L08017A
                        LDA        L6281_
                        STA        [P0872_puc_Bitmap]
                        REP        #0x30
                        INC        P0872_puc_Bitmap
                        BNE        L080178
                        INC        P0872_puc_Bitmap+2
                L080178:
                        SEP        #0x30
                L08017A:
                        BIT        L6265_+1
                        BVC        L08019B
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BNE        L080197
                        BRL        L0803AC
                L080197:
                        REP        #0x30
                        DEC        L6279_
                L08019B:
                        REP        #0x30
                        SEC
                        LDA        L6269_
                        SBC        L6279_
                        STA        L6269_
                        SEP        #0x30
                        BEQ        L0801AB
                        BRL        L080074
                L0801AB:
                        BRL        L0803AC
                L0801AE:
                        PLA
                        AND        #0x0f
                        STA        L6276_
                        LDA        L6279_
                        AND        #0x01
                        BEQ        L0801EC
                        BIT        L6270_
                        BMI        L0801C7
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        BRA        L0801D7
                L0801C7:
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L0801D7
                        INC        P0872_puc_Bitmap+1
                        BNE        L0801D7
                        INC        P0872_puc_Bitmap+2
                L0801D7:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BNE        L0801E8
                        BRL        L0803AC
                L0801E8:
                        REP        #0x30
                        DEC        L6279_
                L0801EC:
                        REP        #0x30
                        LDA        L6279_
                        LSR        A
                        STA        L6265_
                        SEP        #0x30
                        BIT        L6270_
                        BMI        L08024F
                        REP        #0x30
                        LSR        A
                        PHP
                        BEQ        L080227
                        TAX
                        LDY        #0x00
                        INC        P0871_puc_Graphic
                        BNE        L080209
                        INC        P0871_puc_Graphic+2
                L080209:
                        LDA        [P0871_puc_Graphic],Y
                        STA        [P0872_puc_Bitmap],Y
                        INY
                        INY
                        DEX
                        BNE        L080209
                        CLC
                        TYA
                        ADC        P0872_puc_Bitmap
                        STA        P0872_puc_Bitmap
                        BCC        L08021C
                        INC        P0872_puc_Bitmap+2
                L08021C:
                        DEY
                        CLC
                        TYA
                        ADC        P0871_puc_Graphic
                        STA        P0871_puc_Graphic
                        BCC        L080227
                        INC        P0871_puc_Graphic+2
                L080227:
                        PLP
                        BCC        L08023E
                        INC        P0871_puc_Graphic
                        BNE        L080230
                        INC        P0871_puc_Graphic+2
                L080230:
                        SEP        #0x30
                        LDA        [P0871_puc_Graphic]
                        STA        [P0872_puc_Bitmap]
                        REP        #0x30
                        INC        P0872_puc_Bitmap
                        BNE        L08023E
                        INC        P0872_puc_Bitmap+2
                L08023E:
                        SEC
                        LDA        L6269_
                        SBC        L6279_
                        STA        L6269_
                        SEP        #0x30
                        BEQ        L08024C
                        BRL        L080074
                L08024C:
                        BRL        L0803AC
                L08024F:
                        REP        #0x30
                        INC        P0871_puc_Graphic
                        BNE        L080257
                        INC        P0871_puc_Graphic+2
                L080257:
                        SEP        #0x30
                        LDA        [P0871_puc_Graphic]
                        TAX
                        XBA
                        LDA        >G3978_auc_FlippedPixels,X
                        AND        #0x0f
                        STA        L6276_
                        BIT        L6270_
                        BMI        L080273
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        BRA        L080283
                L080273:
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L080283
                        INC        P0872_puc_Bitmap+1
                        BNE        L080283
                        INC        P0872_puc_Bitmap+2
                L080283:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BNE        L080294
                        BRL        L0803AC
                L080294:
                        XBA
                        AND        #0x0f
                        STA        L6276_
                        BIT        L6270_
                        BMI        L0802A7
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        BRA        L0802B7
                L0802A7:
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L0802B7
                        INC        P0872_puc_Bitmap+1
                        BNE        L0802B7
                        INC        P0872_puc_Bitmap+2
                L0802B7:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BNE        L0802C8
                        BRL        L0803AC
                L0802C8:
                        REP        #0x30
                        DEC        L6265_
                        BNE        L08024F
                        SEP        #0x30
                        BRL        L080074
                L0802D3:
                        PLA
                        AND        #0x0f
                        STA        L6281_
                        REP        #0x30
                        SEC
                        LDA        P0872_puc_Bitmap
                        SBC        L6267_
                        STA        L6277_
                        LDA        P0872_puc_Bitmap+2
                        BCS        L0802E6
                        DEC        A
                L0802E6:
                        STA        L6277_+2
                        SEP        #0x30
                        BIT        L6270_
                        BPL        L08031F
                        LDA        [L6277_]
                        AND        #0x0f
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L080300
                        INC        P0872_puc_Bitmap+1
                        BNE        L080300
                        INC        P0872_puc_Bitmap+2
                L080300:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        BNE        L08030F
                        BRL        L0803AC
                L08030F:
                        DEC        L6279_
                        SEP        #0x30
                        BEQ        L080379
                        INC        L6277_
                        BNE        L08031F
                        INC        L6277_+1
                        BNE        L08031F
                        INC        L6277_+2
                L08031F:
                        REP        #0x30
                        STZ        L6265_
                        LDA        L6279_
                        LSR        A
                        ROR        L6265_
                        LSR        A
                        ROR        L6265_
                        TAX
                        LDY        #0x00
                        CMP        #0x00
                        BEQ        L08033D
                L080334:
                        LDA        [L6277_],Y
                        STA        [P0872_puc_Bitmap],Y
                        INY
                        INY
                        DEX
                        BNE        L080334
                L08033D:
                        BIT        L6265_
                        BPL        L08034A
                        SEP        #0x20
                        LDA        [L6277_],Y
                        STA        [P0872_puc_Bitmap],Y
                        INY
                        REP        #0x30
                L08034A:
                        CLC
                        TYA
                        ADC        P0872_puc_Bitmap
                        STA        P0872_puc_Bitmap
                        BCC        L080354
                        INC        P0872_puc_Bitmap+2
                L080354:
                        CLC
                        TYA
                        ADC        L6277_
                        STA        L6277_
                        BCC        L08035E
                        INC        L6277_+2
                L08035E:
                        BIT        L6265_
                        BVC        L080370
                        SEP        #0x30
                        LDA        [L6277_]
                        AND        #0xf0
                        STA        [P0872_puc_Bitmap]
                        LDA        #0x80
                        STA        L6270_
                        REP        #0x30
                L080370:
                        SEC
                        LDA        L6269_
                        SBC        L6279_
                        STA        L6269_
                        SEP        #0x30
                L080379:
                        LDA        L6281_
                        STA        L6276_
                        BIT        L6270_
                        BMI        L08038B
                        LDX        L6276_
                        LDA        >G3978_auc_FlippedPixels,X
                        STA        [P0872_puc_Bitmap]
                        BRA        L08039B
                L08038B:
                        LDA        L6276_
                        ORA        [P0872_puc_Bitmap]
                        STA        [P0872_puc_Bitmap]
                        INC        P0872_puc_Bitmap
                        BNE        L08039B
                        INC        P0872_puc_Bitmap+1
                        BNE        L08039B
                        INC        P0872_puc_Bitmap+2
                L08039B:
                        LDA        L6270_
                        EOR        #0x80
                        STA        L6270_
                        REP        #0x30
                        DEC        L6269_
                        SEP        #0x30
                        BEQ        L0803AC
                        BRL        L080074
                L0803AC:
                        REP        #0x30
        }
        if (L6264_) {
                L6264_ = G0578_B_UseByteBoxCoordinates;
                G0578_B_UseByteBoxCoordinates = C0_FALSE;
                L6273_[0] = P0873_i_X;
                L6273_[2] = P0874_i_Y;
                L6273_[1] = L6273_[0] + L6266_ - 1;
                L6273_[3] = L6273_[2] + L6271_ - 1;
                F0132_VIDEO_Blit(G3979_puc_, NULL, L6273_, 0, 0, L6266_ / 2, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY);
                G0578_B_UseByteBoxCoordinates = L6264_;
        }
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        long L1663_l_;


        AztecCDirective_asm
                        movem.l d4-d7/a2-a5,-(sp)
                        movea.l 8(a5),a0                        ; P0871_puc_Graphic
                        movea.l 12(a5),a1                       ; P0872_puc_Bitmap
                        move.w  16(a5),d5                       ; P0873_i_X
                        move.w  18(a5),d4                       ; P0874_i_Y
                        move.w  (a0)+,d7
                        move.w  (a0)+,d6
                        add.w   #$F,d7
                        lsr.w   #3,d7
                        and.w   #$FFFE,d7
                        cmpa.l  #0,a1
                        bne.s   T0466045
                        movea.l _G0348_Bitmap_Screen,a1
                        move.w  #$28,d0
                        cmp.w   d0,d7
                        beq.s   T0466044
                        lsr.w   #3,d5
                        and.w   #$FFFE,d5
                        adda.w  d5,a1
                        mulu.w  d0,d4
                        adda.w  d4,a1
                        movea.l a1,a3
                        adda.w  d7,a3
                        subq.w  #1,d6
                        mulu.w  d0,d6
                        add.l   a3,d6
                T0466043:
                        move.w  d0,d4
                        sub.w   d7,d4
                        move.w  d4,d7
                        swap    d7
                        move.w  d0,d7
                        move.w  #$1F40,d0
                        bra.s   T0466046
                T0466044:
                        mulu.w  d7,d6
                        movea.l a1,a3
                        adda.l  d6,a3
                        move.l  a3,d6
                        move.w  #$1F40,d0
                        bra.s   T0466046
                T0466045:
                        mulu.w  d7,d6
                        move.w  d6,d0
                        movea.l a1,a3
                        adda.l  d6,a3
                        move.l  a3,d6
                T0466046:
                        move.l  d6,-4(a5)                       ; L1663_l_
                        move.w  d7,d6
                        swap    d6
                        move.w  d0,d6
                        add.w   d0,d6
                        move.w  d6,d7
                        add.w   d0,d7
                        clr.w   (a1)
                        clr.w   (a1,d0.w)
                        clr.w   (a1,d6.w)
                        clr.w   (a1,d7.w)
                        swap    d0
                        move.w  #$F,d0
                        moveq   #0,d4
                        lea     V0466000_Masks1,a4
                        lea     V0466002_BitmapUnits,a6
                T0466047:
                        move.b  (a0)+,d3
                        move.b  d3,d2
                        bmi.s   T0466050
                        and.w   #$F,d2
                        lsr.b   #4,d3
                        moveq   #1,d1
                        add.b   d3,d1
                T0466048:
                        lsl.w   #3,d2
                        movea.l a6,a2
                        adda.w  d2,a2
                        bclr    #$1F,d4
                T0466049:
                        bsr.s   T0466054
                        tst.w   d1
                        bne.s   T0466049
                        bra.s   T0466047
                T0466050:
                        and.w   #$F,d2
                        moveq   #0,d1
                        move.b  (a0)+,d1
                        btst    #6,d3
                        beq.s   T0466051
                        asl.w   #8,d1
                        move.b  (a0)+,d1
                T0466051:
                        addq.w  #1,d1
                        btst    #4,d3
                        beq.s   T0466048
                        btst    #5,d3
                        beq     T0466070
                        movea.l a1,a2
                        swap    d6
                        suba.w  d6,a2
                        swap    d6
                        bset    #$1F,d4
                T0466052:
                        bsr.s   T0466054
                        tst.l   d5
                        beq.s   T0466053
                        movea.l d5,a2
                T0466053:
                        addq.l  #2,a2
                        tst.w   d1
                        bne.s   T0466052
                        bsr     T0466061
                        bra.s   T0466047
                T0466054:
                        move.b  d0,d4
                        lsl.w   #2,d4
                        move.l  (a4,d4.w),d3
                        cmp.w   d1,d0
                        bmi.s   T0466055
                        sub.w   d1,d0
                        move.b  d0,d4
                        lsl.w   #2,d4
                        and.l   $40(a4,d4.w),d3
                        moveq   #0,d1
                        bra.s   T0466056
                T0466055:
                        sub.w   d0,d1
                        subq.w  #1,d1
                        move.w  #$FFFF,d0
                T0466056:
                        btst    #$1F,d4
                        beq.s   T0466057
                        move.w  (a2),d5
                        and.w   d3,d5
                        or.w    d5,(a1)
                        swap    d0
                        move.w  (a2,d0.w),d5
                        and.w   d3,d5
                        or.w    d5,(a1,d0.w)
                        swap    d0
                        move.w  (a2,d6.w),d5
                        and.w   d3,d5
                        or.w    d5,(a1,d6.w)
                        move.w  (a2,d7.w),d5
                        and.w   d3,d5
                        or.w    d5,(a1,d7.w)
                        moveq   #0,d5
                        bra.s   T0466058
                T0466057:
                        move.l  (a2),d5
                        and.l   d3,d5
                        swap    d0
                        or.w    d5,(a1,d0.w)
                        swap    d0
                        swap    d5
                        or.w    d5,(a1)
                        move.l  4(a2),d5
                        and.l   d3,d5
                        or.w    d5,(a1,d7.w)
                        swap    d5
                        or.w    d5,(a1,d6.w)
                        moveq   #0,d5
                T0466058:
                        tst.w   d0
                        bpl.s   T0466060
                        addq.l  #2,a1
                        cmpa.l  a1,a3
                        bne.s   T0466059
                        cmpa.l  -4(a5),a1                       ; L1663_l_
                        beq     T0466072
                        swap    d6
                        swap    d7
                        adda.w  d6,a3
                        adda.w  d7,a1
                        move.l  a2,d5
                        add.w   d7,d5
                        swap    d6
                        swap    d7
                T0466059:
                        move.w  #$F,d0
                        clr.w   (a1)
                        swap    d0
                        clr.w   (a1,d0.w)
                        swap    d0
                        clr.w   (a1,d6.w)
                        clr.w   (a1,d7.w)
                T0466060:
                        rts
                T0466061:
                        move.w  d0,d5
                        btst    #3,d0
                        bne.s   T0466065
                        btst    #3,d2
                        beq.s   T0466062
                        bset    d5,1(a1,d7.w)
                T0466062:
                        btst    #2,d2
                        beq.s   T0466063
                        bset    d5,1(a1,d6.w)
                T0466063:
                        btst    #1,d2
                        beq.s   T0466064
                        swap    d0
                        bset    d5,1(a1,d0.w)
                        swap    d0
                T0466064:
                        btst    #0,d2
                        beq.s   T0466069
                        bset    d5,1(a1)
                        bra.s   T0466069
                T0466065:
                        btst    #3,d2
                        beq.s   T0466066
                        bset    d5,(a1,d7.w)
                T0466066:
                        btst    #2,d2
                        beq.s   T0466067
                        bset    d5,(a1,d6.w)
                T0466067:
                        btst    #1,d2
                        beq.s   T0466068
                        swap    d0
                        bset    d5,(a1,d0.w)
                        swap    d0
                T0466068:
                        btst    #0,d2
                        beq.s   T0466069
                        bset    d5,(a1)
                T0466069:
                        subq.w  #1,d0
                        bra     T0466058
                T0466070:
                        lsr.w   #1,d1
                        bcc.s   T0466071
                        bsr.s   T0466061
                T0466071:
                        move.b  (a0)+,d3
                        move.b  d3,d2
                        lsr.b   #4,d2
                        bsr.s   T0466061
                        move.b  d3,d2
                        bsr.s   T0466061
                        subq.w  #1,d1
                        bne.s   T0466071
                        bra     T0466047
                T0466072:
                        addq.l  #4,sp
                        movem.l (sp)+,d4-d7/a2-a5
                public _G0348_Bitmap_Screen
        AztecCDirective_endasm
#endif
#ifdef MEDIA607_X30J_X31J
#ifdef MEDIA692_X31J
        ASM_STUB_PREFIX
#endif
        asm {
                        movem.l d0-d7/a0-a4,-(sp)
                        moveq   #0,d3
                        movea.l P0871_puc_Graphic(a6),a1
                        movea.l P0872_puc_Bitmap(a6),a0
                        move.w  (a1)+,d3
#ifdef MEDIA692_X31J
                        bpl.s   @Tloc_344
                        move.w  (a1)+,d3
                @Tloc_344:
#endif
                        move.w  (a1)+,d4
                        lea     @Tbyte_12C6E,a4
#ifdef MEDIA577_X30J
                        move.l  a0,d0
                        bne.s   @Tloc_12944
                        bra.w   @Tloc_12CBE
                @Tloc_12944:
#endif
                        moveq   #0,d0
                        moveq   #0,d7
                        move.w  d3,d5
                        lsr.w   #1,d5
                        bcs.w   @Tloc_129F2
                        movea.l a0,a3
                        mulu.w  d5,d4
                        adda.l  d4,a3
                        moveq   #0xF,d4
                        moveq   #0xFFFFFFF0,d6
                @Tloc_1295A:
                        moveq   #1,d2
                        and.b   d7,d2
                        move.b  (a1)+,d0
                        bmi.s   @Tloc_12978
                        move.w  d0,d1
                        lsr.b   #4,d1
                        addq.w  #1,d1
                        and.b   d4,d0
                        add.w   d1,d7
                        bsr.w   @Tloc_12B50
                        cmpa.l  a0,a3
                        bhi.s   @Tloc_1295A
                        bra.w   @Tloc_12CBE
                @Tloc_12978:
#ifdef MEDIA577_X30J
                        moveq   #0,d1
#endif
#ifdef MEDIA692_X31J
                        moveq   #0x30,d1
                        and.b   d0,d1
                        cmpi.b  #0x20,d1
                        bne.s   @Tloc_3C2
                        btst    #6,d0
                        beq.s   @Tloc_392
                        ori.b   #0x10,d0
                @Tloc_392:
                        moveq   #0x1F,d1
                        and.b   d0,d1
                        cmpi.b  #0x1D,d1
                        bmi.s   @Tloc_3B2
                        move.b  d1,d0
                        move.b  (a1)+,d1
                        cmpi.b  #0x1E,d0
                        bmi.s   @Tloc_3B2
                        beq.s   @Tloc_3AE
                        lsl.w   #8,d1
                        move.b  (a1)+,d1
                        bra.s   @Tloc_3B2
                @Tloc_3AE:
                        addi.w  #0x100,d1
                @Tloc_3B2:
                        addq.w  #1,d1
                        add.w   d1,d7
                        bsr.w   @Tloc_5A6
                        cmpa.l  a0,a3
                        bhi.s   @Tloc_1295A
                        bra.w   @Tloc_12CBE
                @Tloc_3C2:
#endif
                        move.b  (a1)+,d1
                        btst    #6,d0
                        beq.s   @Tloc_12986
                        lsl.w   #8,d1
                        move.b  (a1)+,d1
                @Tloc_12986:
                        addq.w  #1,d1
                        add.w   d1,d7
                        btst    #4,d0
                        bne.s   @Tloc_1299E
                        and.b   d4,d0
                        bsr.w   @Tloc_12B50
                        cmpa.l  a0,a3
#ifdef MEDIA577_X30J
                        bhi.s   @Tloc_1295A
#endif
#ifdef MEDIA692_X31J
                        bhi.w   @Tloc_1295A
#endif
                        bra.w   @Tloc_12CBE
                @Tloc_1299E:
                        btst    #5,d0
                        beq.s   @Tloc_129C8
                        movea.l a0,a2
                        suba.w  d5,a2
                        bsr.w   @Tloc_12B08
                        btst    #0,d7
                        bne.s   @Tloc_129B8
                        lsl.b   #4,d0
                        move.b  d0,(a0)
                        bra.s   @Tloc_129BE
                @Tloc_129B8:
                        and.b   d4,d0
                        and.b   d6,(a0)
                        or.b    d0,(a0)+
                @Tloc_129BE:
                        addq.w  #1,d7
                        cmpa.l  a0,a3
#ifdef MEDIA577_X30J
                        bhi.s   @Tloc_1295A
#endif
#ifdef MEDIA692_X31J
                        bhi.w   @Tloc_1295A
#endif
                        bra.w   @Tloc_12CBE
                @Tloc_129C8:
                        btst    #0,d1
                        beq.s   @Tloc_129E4
                        subq.w  #1,d1
                        tst.b   d2
                        beq.s   @Tloc_129DE
                        and.b   d4,d0
                        and.b   d6,(a0)
                        or.b    d0,(a0)+
                        moveq   #0,d2
                        bra.s   @Tloc_129E4
                @Tloc_129DE:
                        lsl.b   #4,d0
                        move.b  d0,(a0)
                        moveq   #1,d2
                @Tloc_129E4:
                        bsr.w   @Tloc_12B9C
                        cmpa.l  a0,a3
                        bhi.w   @Tloc_1295A
                        bra.w   @Tloc_12CBE
                @Tloc_129F2:
                        addq.w  #1,d5
                        movea.l a0,a3
                        mulu.w  d5,d4
                        adda.l  d4,a3
                        moveq   #0,d6
                        move.w  d3,d6
                        moveq   #0xF,d4
                @Tloc_12A00:
                        moveq   #1,d2
                        and.b   d7,d2
                        move.b  (a1)+,d0
                        bmi.s   @Tloc_12A28
                        move.w  d0,d1
                        lsr.b   #4,d1
                        addq.w  #1,d1
                        sub.w   d1,d6
                        bhi.s   @Tloc_12A18
                @Tloc_12A12:
                        addq.w  #1,d1
                        add.w   d3,d6
                        ble.s   @Tloc_12A12
                @Tloc_12A18:
                        add.w   d1,d7
                        and.b   d4,d0
                        bsr.w   @Tloc_12B50
                        cmpa.l  a0,a3
                        bhi.s   @Tloc_12A00
                        bra.w   @Tloc_12CBE
                @Tloc_12A28:
                        moveq   #0x30,d1
                        and.b   d0,d1
                        cmpi.b  #0x10,d1
                        beq.s   @Tloc_12AA4
                        move.b  (a1)+,d1
                        btst    #6,d0
                        beq.s   @Tloc_12A3E
                        lsl.w   #8,d1
                        move.b  (a1)+,d1
                @Tloc_12A3E:
                        addq.w  #1,d1
                        sub.l   d1,d6
                        bhi.s   @Tloc_12A5A
                        addq.l  #1,d1
                        add.l   d3,d6
                        bgt.s   @Tloc_12A5A
                        addq.l  #1,d1
                        neg.l   d6
                        divu.w  d3,d6
                        add.w   d6,d1
                        clr.w   d6
                        swap    d6
                        neg.w   d6
                        add.w   d3,d6
                @Tloc_12A5A:
                        add.w   d1,d7
                        btst    #5,d0
                        bne.s   @Tloc_12A70
                        and.b   d4,d0
                        bsr.w   @Tloc_12B50
                        cmpa.l  a0,a3
                        bhi.s   @Tloc_12A00
                        bra.w   @Tloc_12CBE
                @Tloc_12A70:
                        movea.l a0,a2
                        suba.w  d5,a2
                        bsr.w   @Tloc_12B08
                        btst    #0,d7
                        bne.s   @Tloc_12A8E
                        lsl.b   #4,d0
                        move.b  d0,(a0)
                        subq.w  #1,d6
                        bne.s   @Tloc_12A98
                        addq.l  #1,a0
                        move.w  d3,d6
                        clr.w   d7
                        bra.s   @Tloc_12A9A
                @Tloc_12A8E:
                        and.b   d4,d0
                        andi.b  #0xF0,(a0)
                        or.b    d0,(a0)+
                        subq.w  #1,d6
                @Tloc_12A98:
                        addq.w  #1,d7
                @Tloc_12A9A:
                        cmpa.l  a0,a3
                        bhi.w   @Tloc_12A00
                        bra.w   @Tloc_12CBE
                @Tloc_12AA4:
                        move.b  (a1)+,d1
                        btst    #6,d0
                        beq.s   @Tloc_12AB0
                        lsl.w   #8,d1
                        move.b  (a1)+,d1
                @Tloc_12AB0:
                        addq.w  #1,d1
                        btst    #0,d1
                        beq.s   @Tloc_12ADC
                        addq.w  #1,d7
                        subq.w  #1,d1
                        tst.b   d2
                        beq.s   @Tloc_12ACC
                        and.b   d4,d0
                        andi.b  #0xF0,(a0)
                        or.b    d0,(a0)+
                        subq.w  #1,d6
                        bra.s   @Tloc_12ADA
                @Tloc_12ACC:
                        lsl.b   #4,d0
                        move.b  d0,(a0)
                        moveq   #1,d2
                        subq.w  #1,d6
                        bne.s   @Tloc_12ADC
                        addq.l  #1,a0
                        move.w  d3,d6
#ifdef MEDIA692_X31J
                        moveq   #0,d7
#endif
                @Tloc_12ADA:
                        moveq   #0,d2
                @Tloc_12ADC:
                        sub.l   d1,d6
                        bhi.s   @Tloc_12AF8
                        add.l   d6,d1
                        moveq   #0,d7
                @Tloc_12AE4:
                        bsr.w   @Tloc_12B9C
                        beq.s   @Tloc_12AEC
                        subq.l  #1,a1
                @Tloc_12AEC:
                        addq.l  #1,a0
                        move.w  d3,d1
                        add.l   d3,d6
                        ble.s   @Tloc_12AE4
                        sub.w   d6,d1
                        beq.s   @Tloc_12AFE
                @Tloc_12AF8:
                        add.w   d1,d7
                        bsr.w   @Tloc_12B9C
                @Tloc_12AFE:
                        cmpa.l  a0,a3
                        bhi.w   @Tloc_12A00
                        bra.w   @Tloc_12CBE
                @Tloc_12B08:
                        tst.b   d2
                        beq.s   @Tloc_12B1A
                        moveq   #0xF,d2
                        and.b   (a2)+,d2
                        andi.b  #0xF0,(a0)
                        or.b    d2,(a0)+
                        subq.w  #1,d1
                        beq.s   @Tlocret_12B4E
                @Tloc_12B1A:
                        subq.w  #8,d1
                        bcs.s   @Tloc_12B3E
                        move.w  a0,d2
                        andi.w  #1,d2
                        beq.s   @Tloc_12B2C
                        move.b  (a2)+,(a0)+
                        subq.w  #2,d1
                        bcs.s   @Tloc_12B3E
                @Tloc_12B2C:
                        move.w  a2,d2
                        andi.w  #1,d2
                        beq.s   @Tloc_12B38
                        addq.w  #6,d1
                        bra.s   @Tloc_12B42
                @Tloc_12B38:
                        move.l  (a2)+,(a0)+
                        subq.w  #8,d1
                        bcc.s   @Tloc_12B38
                @Tloc_12B3E:
                        addq.w  #6,d1
                        bcc.s   @Tloc_12B48
                @Tloc_12B42:
                        move.b  (a2)+,(a0)+
                        subq.w  #2,d1
                        bcc.s   @Tloc_12B42
                @Tloc_12B48:
                        addq.w  #1,d1
                        bne.s   @Tlocret_12B4E
#ifdef MEDIA577_X30J
                        move.b  (a2),(a0)
#endif
#ifdef MEDIA692_X31J
                        moveq   #0xFFFFFFF0,d2
                        and.b   (a2),d2
                        andi.b  #0xF,(a0)
                        or.b    d2,(a0)
#endif
                @Tlocret_12B4E:
                        rts
#ifdef MEDIA692_X31J
                @Tloc_5A6:
                        tst.b   d2
                        beq.s   @Tloc_5AE
                        addq.l  #1,a0
                        subq.w  #1,d1
                @Tloc_5AE:
                        lsr.w   #1,d1
                        adda.w  d1,a0
                        rts
#endif
                @Tloc_12B50:
                        tst.b   d2
                        beq.s   @Tloc_12B5E
                        andi.b  #0xF0,(a0)
                        or.b    d0,(a0)+
                        subq.w  #1,d1
                        beq.s   @Tlocret_12B9A
                @Tloc_12B5E:
                        subq.w  #8,d1
                        bcc.s   @Tloc_12B68
                        move.b  (a4,d0.w),d2
                        bra.s   @Tloc_12B8A
                @Tloc_12B68:
                        move.w  a0,d2
                        andi.w  #1,d2
                        beq.s   @Tloc_12B7A
                        move.b  (a4,d0.w),d2
                        move.b  d2,(a0)+
                        subq.w  #2,d1
                        bcs.s   @Tloc_12B8A
                @Tloc_12B7A:
                        move.w  d0,d2
                        add.w   d2,d2
                        add.w   d2,d2
                        move.l  0x10(a4,d2.w),d2
                @Tloc_12B84:
                        move.l  d2,(a0)+
                        subq.w  #8,d1
                        bcc.s   @Tloc_12B84
                @Tloc_12B8A:
                        addq.w  #6,d1
                        bcc.s   @Tloc_12B94
                @Tloc_12B8E:
                        move.b  d2,(a0)+
                        subq.w  #2,d1
                        bcc.s   @Tloc_12B8E
                @Tloc_12B94:
                        addq.w  #1,d1
                        bne.s   @Tlocret_12B9A
#ifdef MEDIA577_X30J
                        move.b  d2,(a0)
#endif
#ifdef MEDIA692_X31J
                        andi.b  #0xF0,d2
                        andi.b  #0xF,(a0)
                        or.b    d2,(a0)
#endif
                @Tlocret_12B9A:
                        rts
                @Tloc_12B9C:
                        tst.b   d2
                        beq.s   @Tloc_12BB6
                        cmpi.b  #3,d2
                        bne.s   @Tloc_12BF0
                        moveq   #0xF,d2
                        and.b   (a1)+,d2
                        andi.b  #0xF0,(a0)
                        or.b    d2,(a0)+
                        subq.w  #1,d1
                        beq.w   @Tloc_12C6A
                @Tloc_12BB6:
                        subq.w  #8,d1
                        bcs.s   @Tloc_12BDA
                        move.w  a0,d0
                        andi.w  #1,d0
                        beq.s   @Tloc_12BC8
                        move.b  (a1)+,(a0)+
                        subq.w  #2,d1
                        bcs.s   @Tloc_12BDA
                @Tloc_12BC8:
                        move.w  a1,d0
                        andi.w  #1,d0
                        beq.s   @Tloc_12BD4
                        addq.w  #6,d1
                        bra.s   @Tloc_12BDE
                @Tloc_12BD4:
                        move.l  (a1)+,(a0)+
                        subq.w  #8,d1
                        bcc.s   @Tloc_12BD4
                @Tloc_12BDA:
                        addq.w  #6,d1
                        bcc.s   @Tloc_12BE4
                @Tloc_12BDE:
                        move.b  (a1)+,(a0)+
                        subq.w  #2,d1
                        bcc.s   @Tloc_12BDE
                @Tloc_12BE4:
                        addq.w  #1,d1
                        bne.w   @Tloc_12C6A
#ifdef MEDIA577_X30J
                        move.b  (a1)+,(a0)
#endif
#ifdef MEDIA692_X31J
                        move.b  #0xF0,d1
                        and.b   (a1)+,d1
                        andi.b  #0xF,(a0)
                        move.b  d1,(a0)
#endif
                @Tloc_12BEC:
                        moveq   #2,d2
                        rts
                @Tloc_12BF0:
                        subq.w  #1,d2
                        bne.s   @Tloc_12C04
                        move.b  (a1)+,d0
                        lsr.b   #4,d0
                        andi.b  #0xF0,(a0)
                        or.b    d0,(a0)+
                        subq.w  #1,d1
                        beq.s   @Tloc_12BEC
                        subq.l  #1,a1
                @Tloc_12C04:
                        move.b  (a1)+,d2
                        subq.w  #4,d1
                        bcs.s   @Tloc_12C50
                        move.w  a0,d0
                        andi.w  #1,d0
                        beq.s   @Tloc_12C22
                        lsl.b   #4,d2
                        move.b  (a1),d0
                        lsr.b   #4,d0
                        or.b    d0,d2
                        move.b  d2,(a0)+
                        move.b  (a1)+,d2
                        subq.w  #2,d1
                        bcs.s   @Tloc_12C50
                @Tloc_12C22:
                        move.w  a1,d0
                        andi.w  #1,d0
                        beq.s   @Tloc_12C40
                @Tloc_12C2A:
                        lsl.w   #8,d2
                        move.b  (a1)+,d2
                        lsl.l   #8,d2
                        move.b  (a1)+,d2
                        move.b  d2,d0
                        lsr.l   #4,d2
                        move.w  d2,(a0)+
                        move.b  d0,d2
                        subq.w  #4,d1
                        bcc.s   @Tloc_12C2A
                        bra.s   @Tloc_12C50
                @Tloc_12C40:
                        swap    d2
                        move.w  (a1)+,d2
                        move.b  d2,d0
                        lsr.l   #4,d2
                        move.w  d2,(a0)+
                        move.b  d0,d2
                        subq.w  #4,d1
                        bcc.s   @Tloc_12C40
                @Tloc_12C50:
                        addq.w  #3,d1
                        beq.s   @Tloc_12C66
                        bmi.s   @Tloc_12BEC
                        lsl.w   #8,d2
                        move.b  (a1)+,d2
                        move.b  d2,d0
                        lsr.w   #4,d2
                        move.b  d2,(a0)+
                        subq.w  #1,d1
                        beq.s   @Tloc_12BEC
                        move.b  d0,d2
                @Tloc_12C66:
                        lsl.b   #4,d2
#ifdef MEDIA577_X30J
                        move.b  d2,(a0)
#endif
#ifdef MEDIA692_X31J
                        andi.b  #0xF,(a0)
                        or.b    d2,(a0)
#endif
                @Tloc_12C6A:
                        moveq   #0,d2
                        rts
                @Tbyte_12C6E:dc.b 0x00
                        dc.b 0x11
                        dc.b 0x22
                        dc.b 0x33
                        dc.b 0x44
                        dc.b 0x55
                        dc.b 0x66
                        dc.b 0x77
                        dc.b 0x88
                        dc.b 0x99
                        dc.b 0xAA
                        dc.b 0xBB
                        dc.b 0xCC
                        dc.b 0xDD
                        dc.b 0xEE
                        dc.b 0xFF
                        dc.l 0x00000000
                        dc.l 0x11111111
                        dc.l 0x22222222
                        dc.l 0x33333333
                        dc.l 0x44444444
                        dc.l 0x55555555
                        dc.l 0x66666666
                        dc.l 0x77777777
                        dc.l 0x88888888
                        dc.l 0x99999999
                        dc.l 0xAAAAAAAA
                        dc.l 0xBBBBBBBB
                        dc.l 0xCCCCCCCC
                        dc.l 0xDDDDDDDD
                        dc.l 0xEEEEEEEE
                        dc.l 0xFFFFFFFF
                @Tloc_12CBE:
                        movem.l (sp)+,d0-d7/a0-a4
        }
#ifdef MEDIA692_X31J
        ASM_STUB_SUFFIX
#endif
#endif
#ifdef MEDIA752_A36M_A31E_A31M_A33M_A35E_A35M_AU1E_AU2E
#if ((EXETYPE != C01_SWOOSH) && (EXETYPE != C13_GRF1) && (EXETYPE != C07_HINT))
        int16_t L2657_i_X;
        int16_t L2658_i_Y;


        L2657_i_X = 0;
        L2658_i_Y = 0;
#endif
#if (defined(MEDIA619_A31E_A31M) && (EXETYPE == C13_GRF1))
        ASM_STUB_PREFIX
#endif
        asm {
#if ((EXETYPE == C01_SWOOSH) || (EXETYPE == C07_HINT) || (defined(MEDIA619_A31E_A31M) && (EXETYPE == C13_GRF1)))
                        movem.l d0-d7/a0-a6,-(sp)
#else
                        movem.l d3-d7/a2-a6,-(sp)
#endif
                        movea.l P0871_puc_Graphic(a6),a1
                        movea.l P0872_puc_Bitmap(a6),a0
                        moveq   #0,d3
                @Tloc_10C7E:
                        move.w  (a1)+,d3
                        cmpi.w  #0xFF81,d3
                        beq.s   @Tloc_10C7E
                        move.w  (a1)+,d4
                        move.w  d3,d0
                        swap    d0
                        move.l  d3,d5
                        addi.w  #0xF,d5
                        andi.w  #0xFFF0,d5
                        move.l  a0,d7
                        beq.s   @Tloc_10CA0
                        cmp.w   d3,d5
                        bne.s   @Tloc_10CD0
                        bra.s   @Tloc_10CD0
                @Tloc_10CA0:
#if (defined(MEDIA619_A31E_A31M) && (EXETYPE == C13_GRF1))
                        bra.w   @Tloc_1120E
#endif
#if (EXETYPE != C13_GRF1)
                        lsr.w   #4,d5
                        movea.l G0348_Bitmap_Screen(a5),a0
#if ((EXETYPE == C01_SWOOSH) || (EXETYPE == C07_HINT))
                        move.w  P0874_i_Y(a6),d7
#else
                        move.w  L2658_i_Y(a6),d7
#endif
                        mulu.w  #0x28,d7
                        move.w  d7,d0
#if ((EXETYPE == C01_SWOOSH) || (EXETYPE == C07_HINT))
                        move.w  P0873_i_X(a6),d1
#else
                        move.w  L2657_i_X(a6),d1
#endif
                        lsr.w   #3,d1
                        andi.w  #0xFFFE,d1
                        add.w   d1,d0
                        adda.w  d0,a0
                        move.w  #0x28,d6
                        swap    d6
                        move.w  #0x1F40,d0
                        subq.w  #1,d4
                        mulu.w  #0x28,d4
                        bra.s   @Tloc_10CE2
#endif
                @Tloc_10CD0:
                        lsr.w   #3,d5
                        move.w  d5,d0
                        move.w  d0,d6
                        swap    d6
                        move.w  d0,d7
                        mulu.w  d4,d7
                        move.w  d7,d0
                        subq.w  #1,d4
                        mulu.w  d5,d4
#if (EXETYPE != C13_GRF1)
                @Tloc_10CE2:
#endif
                        lea     @Tword_1114E,a6
                        lea     @Tword_111CE,a5
                        move.w  d0,d6
                        add.w   d0,d6
                        move.w  d6,d7
                        add.w   d0,d7
                        movea.l a0,a3
                        movea.l a0,a4
                        adda.w  d4,a4
                        swap    d0
                        move.w  d0,d3
                        swap    d0
                        addi.w  #0xF,d3
                        andi.w  #0xFFF0,d3
                        lsr.w   #3,d3
                        adda.w  d3,a4
                        moveq   #0,d4
                @Tloc_10D0C:
                        cmpa.l  a0,a4
                        ble.w   @Tloc_1120E
                        move.b  (a1)+,d3
                        move.b  d3,d2
                        bmi.s   @Tloc_10D7A
                        andi.w  #0xF,d2
                        lsr.b   #4,d3
                        moveq   #1,d1
                        add.b   d3,d1
                @Tloc_10D22:
                        lsl.w   #3,d2
                        movea.l a6,a2
                        adda.w  d2,a2
                @Tloc_10D28:
                        move.w  d4,d5
                        swap    d4
                        swap    d0
                        move.w  d0,d4
                        sub.w   d5,d4
                        cmp.w   d1,d4
                        bcc.s   @Tloc_10D5C
                        swap    d0
                        swap    d1
                        move.w  d4,d1
                        swap    d4
                        bsr.w   @Tloc_11062
                        swap    d1
                        swap    d6
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        swap    d4
                        sub.w   d4,d1
                        bls.s   @Tloc_10D56
                        moveq   #0,d4
                        bra.s   @Tloc_10D28
                @Tloc_10D56:
                        swap    d4
                        bra.w   @Tloc_10D0C
                @Tloc_10D5C:
                        swap    d4
                        swap    d0
                        bsr.w   @Tloc_11062
                        swap    d0
                        cmp.w   d0,d4
                        blt.s   @Tloc_10D74
                        swap    d6
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        moveq   #0,d4
                @Tloc_10D74:
                        swap    d0
                        bra.w   @Tloc_10D0C
                @Tloc_10D7A:
                        btst    #4,d3
                        bne.s   @Tloc_10D88
                        btst    #5,d3
                        bne.w   @Tloc_10E56
                @Tloc_10D88:
                        andi.w  #0xF,d2
                        moveq   #0,d1
                        move.b  (a1)+,d1
                        btst    #6,d3
                        beq.s   @Tloc_10D9A
                        asl.w   #8,d1
                        move.b  (a1)+,d1
                @Tloc_10D9A:
                        addq.w  #1,d1
                        btst    #4,d3
                        beq.w   @Tloc_10D22
                        btst    #5,d3
                        beq.s   @Tloc_10E18
                        swap    d6
                        movea.l a0,a2
                        suba.w  d6,a2
                        swap    d6
                @Tloc_10DB2:
                        move.w  d4,d5
                        swap    d4
                        swap    d0
                        move.w  d0,d4
                        sub.w   d5,d4
                        cmp.w   d1,d4
                        bcc.s   @Tloc_10DF0
                        swap    d0
                        swap    d1
                        move.w  d4,d1
                        swap    d4
                        bsr.w   @Tloc_10F7E
                        swap    d1
                        swap    d6
                        movea.l a3,a2
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        swap    d4
                        sub.w   d4,d1
                        bls.s   @Tloc_10DE2
                        moveq   #0,d4
                        bra.s   @Tloc_10DB2
                @Tloc_10DE2:
                        swap    d4
                        bsr.w   @Tloc_10EF2
                        bsr.w   @Tloc_10E3E
                        bra.w   @Tloc_10D0C
                @Tloc_10DF0:
                        swap    d4
                        swap    d0
                        bsr.w   @Tloc_10F7E
                        swap    d0
                        cmp.w   d0,d4
                        blt.s   @Tloc_10E0A
                        swap    d6
                        movea.l a3,a2
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        moveq   #0,d4
                @Tloc_10E0A:
                        swap    d0
                        bsr.w   @Tloc_10EF2
                        bsr.w   @Tloc_10E3E
                        bra.w   @Tloc_10D0C
                @Tloc_10E18:
                        lsr.w   #1,d1
                        bcc.s   @Tloc_10E20
                        bsr.w   @Tloc_10EF2
                @Tloc_10E20:
                        bsr.s   @Tloc_10E3E
                        move.b  (a1)+,d3
                        move.b  d3,d2
                        lsr.b   #4,d2
                        bsr.w   @Tloc_10EF2
                        bsr.s   @Tloc_10E3E
                        move.b  d3,d2
                        bsr.w   @Tloc_10EF2
                        subq.w  #1,d1
                        bne.s   @Tloc_10E20
                        bsr.s   @Tloc_10E3E
                        bra.w   @Tloc_10D0C
                @Tloc_10E3E:
                        swap    d0
                        cmp.w   d0,d4
                        blt.s   @Tloc_10E52
                        swap    d0
                        swap    d6
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        moveq   #0,d4
                        rts
                @Tloc_10E52:
                        swap    d0
                        rts
                @Tloc_10E56:
                        moveq   #0,d2
                        moveq   #0,d1
                        move.b  d3,d2
                        andi.b  #0xF,d2
                        btst    #6,d3
                        beq.s   @Tloc_10E6A
                        bset    #4,d2
                @Tloc_10E6A:
                        move.b  d2,d1
                        cmpi.b  #0x1D,d2
                        blt.s   @Tloc_10E84
                        beq.s   @Tloc_10E82
                        move.w  #0x100,d1
                        cmpi.b  #0x1E,d2
                        beq.s   @Tloc_10E82
                        move.b  (a1)+,d1
                        lsl.w   #8,d1
                @Tloc_10E82:
                        move.b  (a1)+,d1
                @Tloc_10E84:
                        addq.w  #1,d1
                        move.w  d4,d5
                        swap    d4
                        swap    d0
                        move.w  d0,d4
                        swap    d0
                        sub.w   d5,d4
                        cmp.w   d1,d4
                        bcc.s   @Tloc_10EC8
                        swap    d6
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        sub.w   d4,d1
                        bhi.s   @Tloc_10EA8
                        moveq   #0,d4
                        bra.w   @Tloc_10D0C
                @Tloc_10EA8:
                        moveq   #0,d5
                        move.w  d1,d5
                        swap    d0
                        divu.w  d0,d5
                        beq.s   @Tloc_10EC2
                        swap    d5
                        move.w  d5,d4
                        swap    d5
                        swap    d6
                        mulu.w  d6,d5
                        swap    d6
                        adda.w  d5,a3
                        bra.s   @Tloc_10EE2
                @Tloc_10EC2:
                        swap    d5
                        move.w  d5,d4
                        bra.s   @Tloc_10EE2
                @Tloc_10EC8:
                        swap    d4
                        add.w   d1,d4
                        swap    d0
                        cmp.w   d0,d4
                        blt.s   @Tloc_10EE2
                        swap    d0
                        swap    d6
                        adda.w  d6,a3
                        swap    d6
                        movea.l a3,a0
                        moveq   #0,d4
                        bra.w   @Tloc_10D0C
                @Tloc_10EE2:
                        swap    d0
                        move.w  d4,d5
                        lsr.w   #4,d5
                        add.w   d5,d5
                        movea.l a3,a0
                        adda.w  d5,a0
                        bra.w   @Tloc_10D0C
                @Tloc_10EF2:
                        move.w  d4,d5
                        andi.w  #7,d5
                        subq.w  #7,d5
                        neg.w   d5
                        btst    #3,d4
                        bne.s   @Tloc_10F38
                        bclr    d5,(a0,d7.w)
                        btst    #3,d2
                        beq.s   @Tloc_10F10
                        bset    d5,(a0,d7.w)
                @Tloc_10F10:
                        bclr    d5,(a0,d6.w)
                        btst    #2,d2
                        beq.s   @Tloc_10F1E
                        bset    d5,(a0,d6.w)
                @Tloc_10F1E:
                        bclr    d5,(a0,d0.w)
                        btst    #1,d2
                        beq.s   @Tloc_10F2C
                        bset    d5,(a0,d0.w)
                @Tloc_10F2C:
                        bclr    d5,(a0)
                        btst    #0,d2
                        beq.s   @Tloc_10F70
                        bset    d5,(a0)
                        bra.s   @Tloc_10F70
                @Tloc_10F38:
                        bclr    d5,1(a0,d7.w)
                        btst    #3,d2
                        beq.s   @Tloc_10F46
                        bset    d5,1(a0,d7.w)
                @Tloc_10F46:
                        bclr    d5,1(a0,d6.w)
                        btst    #2,d2
                        beq.s   @Tloc_10F54
                        bset    d5,1(a0,d6.w)
                @Tloc_10F54:
                        bclr    d5,1(a0,d0.w)
                        btst    #1,d2
                        beq.s   @Tloc_10F62
                        bset    d5,1(a0,d0.w)
                @Tloc_10F62:
                        bclr    d5,1(a0)
                        btst    #0,d2
                        beq.s   @Tloc_10F70
                        bset    d5,1(a0)
                @Tloc_10F70:
                        addq.w  #1,d4
                        move.w  d4,d5
                        andi.w  #0xF,d5
                        bne.s   @Tlocret_10F7C
                        addq.w  #2,a0
                @Tlocret_10F7C:
                        rts
                @Tloc_10F7E:
                        move.l  d2,-(sp)
                        move.w  d4,d5
                        add.w   d1,d4
                        andi.w  #0xF,d5
                        moveq   #0x10,d2
                        sub.w   d5,d2
                        add.w   d5,d5
                        move.w  (a5,d5.w),d3
                        swap    d7
                        move.w  d4,d5
                        andi.w  #0xF,d5
                        add.w   d5,d5
                        move.w  0x20(a5,d5.w),d7
                        cmp.w   d2,d1
                        bge.s   @Tloc_10FA6
                @Tloc_10FA4:
                        and.w   d7,d3
                @Tloc_10FA6:
                        swap    d7
                        move.w  d3,d5
                        not.w   d5
                        and.w   d5,(a0)
                        and.w   d5,(a0,d0.w)
                        and.w   d5,(a0,d6.w)
                        and.w   d5,(a0,d7.w)
                        move.w  (a2)+,d5
                        and.w   d3,d5
                        or.w    d5,(a0)+
                        move.w  -2(a2,d0.w),d5
                        and.w   d3,d5
                        or.w    d5,-2(a0,d0.w)
                        move.w  -2(a2,d6.w),d5
                        and.w   d3,d5
                        or.w    d5,-2(a0,d6.w)
                        move.w  -2(a2,d7.w),d5
                        and.w   d3,d5
                        or.w    d5,-2(a0,d7.w)
                        sub.w   d2,d1
                        ble.s   @Tloc_1104E
                        cmpi.w  #0x10,d1
                        blt.s   @Tloc_1103E
                        move.w  d1,-(sp)
                        lsr.w   #4,d1
                @Tloc_10FEC:
                        cmpi.w  #4,d1
                        blt.s   @Tloc_11038
                        move.l  (a2)+,(a0)+
                        move.l  (a2),(a0)
                        lea     -4(a2,d0.w),a2
                        lea     -4(a0,d0.w),a0
                        move.l  (a2)+,(a0)+
                        move.l  (a2),(a0)
                        lea     -4(a2,d0.w),a2
                        lea     -4(a0,d0.w),a0
                        move.l  (a2)+,(a0)+
                        move.l  (a2),(a0)
                        lea     -4(a2,d0.w),a2
                        lea     -4(a0,d0.w),a0
                        move.l  (a2)+,(a0)+
                        move.l  (a2)+,(a0)+
                        suba.w  d7,a2
                        suba.w  d7,a0
                        subq.w  #4,d1
                        bgt.s   @Tloc_10FEC
                        bra.s   @Tloc_11038
                @Tloc_11024:
                        move.w  (a2)+,(a0)+
                        move.w  -2(a2,d0.w),-2(a0,d0.w)
                        move.w  -2(a2,d6.w),-2(a0,d6.w)
                        move.w  -2(a2,d7.w),-2(a0,d7.w)
                @Tloc_11038:
                        dbf     d1,@Tloc_11024
                        move.w  (sp)+,d1
                @Tloc_1103E:
                        moveq   #0xFFFFFFFF,d3
                        moveq   #0x10,d2
                        swap    d7
                        andi.w  #0xF,d1
                        bgt.w   @Tloc_10FA4
                        swap    d7
                @Tloc_1104E:
                        swap    d7
                        tst.w   d7
                        beq.s   @Tloc_1105C
                        subq.w  #2,a0
                        swap    d7
                        move.l  (sp)+,d2
                        rts
                @Tloc_1105C:
                        swap    d7
                        move.l  (sp)+,d2
                        rts
                @Tloc_11062:
                        move.l  d2,-(sp)
                        move.w  d4,d5
                        add.w   d1,d4
                        andi.w  #0xF,d5
                        moveq   #0x10,d2
                        sub.w   d5,d2
                        add.w   d5,d5
                        move.w  (a5,d5.w),d3
                        swap    d7
                        move.w  d4,d5
                        andi.w  #0xF,d5
                        add.w   d5,d5
                        move.w  0x20(a5,d5.w),d7
                        cmp.w   d2,d1
                        bge.s   @Tloc_1108A
                @Tloc_11088:
                        and.w   d7,d3
                @Tloc_1108A:
                        swap    d7
                        move.w  d3,d5
                        swap    d3
                        move.w  d5,d3
                        not.w   d5
                        and.w   d5,(a0)
                        and.w   d5,(a0,d0.w)
                        and.w   d5,(a0,d6.w)
                        and.w   d5,(a0,d7.w)
                        move.l  (a2),d5
                        and.l   d3,d5
                        or.w    d5,(a0)+
                        swap    d5
                        or.w    d5,-2(a0,d0.w)
                        move.l  4(a2),d5
                        beq.s   @Tloc_110C0
                        and.l   d3,d5
                        or.w    d5,-2(a0,d6.w)
                        swap    d5
                        or.w    d5,-2(a0,d7.w)
                @Tloc_110C0:
                        sub.w   d2,d1
                        ble.s   @Tloc_1113A
                        cmpi.w  #0x10,d1
                        blt.s   @Tloc_1112A
                        move.w  d1,-(sp)
                        move.w  d4,-(sp)
                        lsr.w   #4,d1
                        move.w  (a2)+,d3
                        move.w  (a2)+,d2
                        move.w  (a2)+,d5
                        move.w  (a2),d4
                        subq.l  #6,a2
                @Tloc_110DA:
                        cmpi.w  #4,d1
                        blt.s   @Tloc_11122
                        move.w  d2,(a0)+
                        move.w  d2,(a0)+
                        move.w  d2,(a0)+
                        move.w  d2,(a0)
                        lea     -6(a0,d0.w),a0
                        move.w  d3,(a0)+
                        move.w  d3,(a0)+
                        move.w  d3,(a0)+
                        move.w  d3,(a0)
                        lea     -6(a0,d0.w),a0
                        move.w  d4,(a0)+
                        move.w  d4,(a0)+
                        move.w  d4,(a0)+
                        move.w  d4,(a0)
                        lea     -6(a0,d0.w),a0
                        move.w  d5,(a0)+
                        move.w  d5,(a0)+
                        move.w  d5,(a0)+
                        move.w  d5,(a0)+
                        suba.w  d7,a0
                        subq.w  #4,d1
                        bgt.s   @Tloc_110DA
                        bra.s   @Tloc_11122
                @Tloc_11114:
                        move.w  d2,(a0)+
                        move.w  d3,-2(a0,d0.w)
                        move.w  d4,-2(a0,d6.w)
                        move.w  d5,-2(a0,d7.w)
                @Tloc_11122:
                        dbf     d1,@Tloc_11114
                        move.w  (sp)+,d4
                        move.w  (sp)+,d1
                @Tloc_1112A:
                        moveq   #0xFFFFFFFF,d3
                        moveq   #0x10,d2
                        swap    d7
                        andi.w  #0xF,d1
                        bgt.w   @Tloc_11088
                        swap    d7
                @Tloc_1113A:
                        swap    d7
                        tst.w   d7
                        beq.s   @Tloc_11148
                        subq.w  #2,a0
                        swap    d7
                        move.l  (sp)+,d2
                        rts
                @Tloc_11148:
                        swap    d7
                        move.l  (sp)+,d2
                        rts
                @Tword_1114E:
                        dc.w 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000, 0x0000
                        dc.w 0xFFFF, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000
                        dc.w 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF
                        dc.w 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0xFFFF
                        dc.w 0x0000, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000
                        dc.w 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000
                        dc.w 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF
                        dc.w 0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
                @Tword_111CE:
                        dc.w 0xFFFF, 0x7FFF, 0x3FFF, 0x1FFF, 0x0FFF, 0x07FF, 0x03FF, 0x01FF
                        dc.w 0x00FF, 0x007F, 0x003F, 0x001F, 0x000F, 0x0007, 0x0003, 0x0001
                        dc.w 0x0000, 0x8000, 0xC000, 0xE000, 0xF000, 0xF800, 0xFC00, 0xFE00
                        dc.w 0xFF00, 0xFF80, 0xFFC0, 0xFFE0, 0xFFF0, 0xFFF8, 0xFFFC, 0xFFFE
                @Tloc_1120E:
#if ((EXETYPE == C01_SWOOSH) || (EXETYPE == C07_HINT) || (defined(MEDIA619_A31E_A31M) && (EXETYPE == C13_GRF1)))
                        movem.l (sp)+,d0-d7/a0-a6
#else
                        movem.l (sp)+,d3-d7/a2-a6
#endif
        }
#if (defined(MEDIA619_A31E_A31M) && (EXETYPE == C13_GRF1))
        ASM_STUB_SUFFIX
#endif
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
        if (P0872_puc_Bitmap != NULL) {
                F0689_IMG_ExpandGraphicToBitmap(P0871_puc_Graphic, P0872_puc_Bitmap);
        } else {
#if (defined(MEDIA458_P20JA_P20JB) || (defined(MEDIA667_P31J) && (EXETYPE == C06_CEDT)))
                F0691_IMG_ExpandGraphicToScreen(P0871_puc_Graphic, P0873_i_X, P0874_i_Y);
#else
                F0691_IMG_ExpandGraphicToScreen(P0871_puc_Graphic, 0, 0);
#endif
        }
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
#if (defined(MEDIA488_F20E_F20J) || (defined(MEDIA670_F31E_F31J) && (EXETYPE == C06_CEDT)))
        int16_t L6519_ai_Box[4];
#else
        int16_t L6519_ai_Box[4] = { 0, 0, 320, 200 };
#endif
        int16_t L6517_i_Width;
        int16_t L6518_i_Height;


        if (P0872_puc_Bitmap != NULL) {
                F0689_IMG_ExpandGraphicToBitmap(P0871_puc_Graphic, P0872_puc_Bitmap);
        } else {
                L6517_i_Width = *((int16_t*)P0871_puc_Graphic);
                L6518_i_Height = *((int16_t*)(P0871_puc_Graphic + 2));
                F0689_IMG_ExpandGraphicToBitmap(P0871_puc_Graphic, G4108_DEC_BUF);
#if (defined(MEDIA488_F20E_F20J) || (defined(MEDIA670_F31E_F31J) && (EXETYPE == C06_CEDT)))
                L6519_ai_Box[0] = P0873_i_X;
                L6519_ai_Box[1] = P0873_i_X + L6517_i_Width - 1;
                L6519_ai_Box[2] = P0874_i_Y;
                L6519_ai_Box[3] = P0874_i_Y + L6518_i_Height - 1;
#ifdef MEDIA488_F20E_F20J
                F0132_VIDEO_Blit(G4108_DEC_BUF, NULL, L6519_ai_Box, 0, 0, L6517_i_Width, 320, CM1_COLOR_NO_TRANSPARENCY, 0); /* ANOMALY_FMT Extra last parameter */
#endif
#ifdef MEDIA670_F31E_F31J
                F7330_DrawBitmap(G4108_DEC_BUF, NULL, L6519_ai_Box, 0, 0, L6517_i_Width, 320, CM1_COLOR_NO_TRANSPARENCY, 0); /* ANOMALY_FMT Missing last parameter */
#endif
#else
                F0132_VIDEO_Blit(G4108_DEC_BUF, NULL, L6519_ai_Box, 0, 0, L6517_i_Width, 320, CM1_COLOR_NO_TRANSPARENCY); /* Fixed */
#endif
        }
#endif
}

#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
AztecCDirective_asm
        V0466000_Masks1:
                dc.w $0001,$0001,$0003,$0003
                dc.w $0007,$0007,$000F,$000F
                dc.w $001F,$001F,$003F,$003F
                dc.w $007F,$007F,$00FF,$00FF
                dc.w $01FF,$01FF,$03FF,$03FF
                dc.w $07FF,$07FF,$0FFF,$0FFF
                dc.w $1FFF,$1FFF,$3FFF,$3FFF
                dc.w $7FFF,$7FFF,$FFFF,$FFFF
                dc.w $FFFE,$FFFE,$FFFC,$FFFC
                dc.w $FFF8,$FFF8,$FFF0,$FFF0
                dc.w $FFE0,$FFE0,$FFC0,$FFC0
                dc.w $FF80,$FF80,$FF00,$FF00
                dc.w $FE00,$FE00,$FC00,$FC00
                dc.w $F800,$F800,$F000,$F000
                dc.w $E000,$E000,$C000,$C000
                dc.w $8000,$8000,$0000,$0000
        V0466002_BitmapUnits:
                dc.w $0000,$0000,$0000,$0000
                dc.w $FFFF,$0000,$0000,$0000
                dc.w $0000,$FFFF,$0000,$0000
                dc.w $FFFF,$FFFF,$0000,$0000
                dc.w $0000,$0000,$FFFF,$0000
                dc.w $FFFF,$0000,$FFFF,$0000
                dc.w $0000,$FFFF,$FFFF,$0000
                dc.w $FFFF,$FFFF,$FFFF,$0000
                dc.w $0000,$0000,$0000,$FFFF
                dc.w $FFFF,$0000,$0000,$FFFF
                dc.w $0000,$FFFF,$0000,$FFFF
                dc.w $FFFF,$FFFF,$0000,$FFFF
                dc.w $0000,$0000,$FFFF,$FFFF
                dc.w $FFFF,$0000,$FFFF,$FFFF
                dc.w $0000,$FFFF,$FFFF,$FFFF
                dc.w $FFFF,$FFFF,$FFFF,$FFFF
AztecCDirective_endasm
#endif
#endif
