static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,

                                     DCTELEM *block, int n, int qscale)

{

    int nCoeffs;

    const UINT16 *quant_matrix;

    

    if(s->alternate_scan) nCoeffs= 64;

    else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ];



    if (s->mb_intra) {

        int block0;

        if (n < 4) 

            block0 = block[0] * s->y_dc_scale;

        else

            block0 = block[0] * s->c_dc_scale;

        /* XXX: only mpeg1 */

        quant_matrix = s->intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\n\t"

		"psrlw $15, %%mm7		\n\t"

		"movd %2, %%mm6			\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

                "movl %3, %%eax			\n\t"

		".balign 16\n\t"

		"1:				\n\t"

		"movq (%0, %%eax), %%mm0	\n\t"

		"movq 8(%0, %%eax), %%mm1	\n\t"

		"movq (%1, %%eax), %%mm4	\n\t"

		"movq 8(%1, %%eax), %%mm5	\n\t"

		"pmullw %%mm6, %%mm4		\n\t" // q=qscale*quant_matrix[i]

		"pmullw %%mm6, %%mm5		\n\t" // q=qscale*quant_matrix[i]

		"pxor %%mm2, %%mm2		\n\t"

		"pxor %%mm3, %%mm3		\n\t"

		"pcmpgtw %%mm0, %%mm2		\n\t" // block[i] < 0 ? -1 : 0

		"pcmpgtw %%mm1, %%mm3		\n\t" // block[i] < 0 ? -1 : 0

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t" // abs(block[i])

		"psubw %%mm3, %%mm1		\n\t" // abs(block[i])

		"pmullw %%mm4, %%mm0		\n\t" // abs(block[i])*q

		"pmullw %%mm5, %%mm1		\n\t" // abs(block[i])*q

		"pxor %%mm4, %%mm4		\n\t"

		"pxor %%mm5, %%mm5		\n\t" // FIXME slow

		"pcmpeqw (%0, %%eax), %%mm4	\n\t" // block[i] == 0 ? -1 : 0

		"pcmpeqw 8(%0, %%eax), %%mm5	\n\t" // block[i] == 0 ? -1 : 0

		"psraw $3, %%mm0		\n\t"

		"psraw $3, %%mm1		\n\t"

		"psubw %%mm7, %%mm0		\n\t"

		"psubw %%mm7, %%mm1		\n\t"

		"por %%mm7, %%mm0		\n\t"

		"por %%mm7, %%mm1		\n\t"

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t"

		"psubw %%mm3, %%mm1		\n\t"

		"pandn %%mm0, %%mm4		\n\t"

		"pandn %%mm1, %%mm5		\n\t"

		"movq %%mm4, (%0, %%eax)	\n\t"

		"movq %%mm5, 8(%0, %%eax)	\n\t"



		"addl $16, %%eax		\n\t"

		"js 1b				\n\t"

		::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)

		: "%eax", "memory"

	);    

        block[0]= block0;



        } else {

        quant_matrix = s->non_intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\n\t"

		"psrlw $15, %%mm7		\n\t"

		"movd %2, %%mm6			\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

                "movl %3, %%eax			\n\t"

		".balign 16\n\t"

		"1:				\n\t"

		"movq (%0, %%eax), %%mm0	\n\t"

		"movq 8(%0, %%eax), %%mm1	\n\t"

		"movq (%1, %%eax), %%mm4	\n\t"

		"movq 8(%1, %%eax), %%mm5	\n\t"

		"pmullw %%mm6, %%mm4		\n\t" // q=qscale*quant_matrix[i]

		"pmullw %%mm6, %%mm5		\n\t" // q=qscale*quant_matrix[i]

		"pxor %%mm2, %%mm2		\n\t"

		"pxor %%mm3, %%mm3		\n\t"

		"pcmpgtw %%mm0, %%mm2		\n\t" // block[i] < 0 ? -1 : 0

		"pcmpgtw %%mm1, %%mm3		\n\t" // block[i] < 0 ? -1 : 0

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t" // abs(block[i])

		"psubw %%mm3, %%mm1		\n\t" // abs(block[i])

		"paddw %%mm0, %%mm0		\n\t" // abs(block[i])*2

		"paddw %%mm1, %%mm1		\n\t" // abs(block[i])*2

		"paddw %%mm7, %%mm0		\n\t" // abs(block[i])*2 + 1

		"paddw %%mm7, %%mm1		\n\t" // abs(block[i])*2 + 1

		"pmullw %%mm4, %%mm0		\n\t" // (abs(block[i])*2 + 1)*q

		"pmullw %%mm5, %%mm1		\n\t" // (abs(block[i])*2 + 1)*q

		"pxor %%mm4, %%mm4		\n\t"

		"pxor %%mm5, %%mm5		\n\t" // FIXME slow

		"pcmpeqw (%0, %%eax), %%mm4	\n\t" // block[i] == 0 ? -1 : 0

		"pcmpeqw 8(%0, %%eax), %%mm5	\n\t" // block[i] == 0 ? -1 : 0

		"psraw $4, %%mm0		\n\t"

		"psraw $4, %%mm1		\n\t"

		"psubw %%mm7, %%mm0		\n\t"

		"psubw %%mm7, %%mm1		\n\t"

		"por %%mm7, %%mm0		\n\t"

		"por %%mm7, %%mm1		\n\t"

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t"

		"psubw %%mm3, %%mm1		\n\t"

		"pandn %%mm0, %%mm4		\n\t"

		"pandn %%mm1, %%mm5		\n\t"

		"movq %%mm4, (%0, %%eax)	\n\t"

		"movq %%mm5, 8(%0, %%eax)	\n\t"



		"addl $16, %%eax		\n\t"

		"js 1b				\n\t"

		::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)

		: "%eax", "memory"

	);

    }

}

static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,

                                     DCTELEM *block, int n, int qscale)

{

    int nCoeffs;

    const UINT16 *quant_matrix;

    

    if(s->alternate_scan) nCoeffs= 64;

    else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ];



    if (s->mb_intra) {

        int block0;

        if (n < 4) 

            block0 = block[0] * s->y_dc_scale;

        else

            block0 = block[0] * s->c_dc_scale;

        

        quant_matrix = s->intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\n\t"

		"psrlw $15, %%mm7		\n\t"

		"movd %2, %%mm6			\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

                "movl %3, %%eax			\n\t"

		".balign 16\n\t"

		"1:				\n\t"

		"movq (%0, %%eax), %%mm0	\n\t"

		"movq 8(%0, %%eax), %%mm1	\n\t"

		"movq (%1, %%eax), %%mm4	\n\t"

		"movq 8(%1, %%eax), %%mm5	\n\t"

		"pmullw %%mm6, %%mm4		\n\t" 

		"pmullw %%mm6, %%mm5		\n\t" 

		"pxor %%mm2, %%mm2		\n\t"

		"pxor %%mm3, %%mm3		\n\t"

		"pcmpgtw %%mm0, %%mm2		\n\t" 

		"pcmpgtw %%mm1, %%mm3		\n\t" 

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t" 

		"psubw %%mm3, %%mm1		\n\t" 

		"pmullw %%mm4, %%mm0		\n\t" *q

		"pmullw %%mm5, %%mm1		\n\t" *q

		"pxor %%mm4, %%mm4		\n\t"

		"pxor %%mm5, %%mm5		\n\t" 

		"pcmpeqw (%0, %%eax), %%mm4	\n\t" 

		"pcmpeqw 8(%0, %%eax), %%mm5	\n\t" 

		"psraw $3, %%mm0		\n\t"

		"psraw $3, %%mm1		\n\t"

		"psubw %%mm7, %%mm0		\n\t"

		"psubw %%mm7, %%mm1		\n\t"

		"por %%mm7, %%mm0		\n\t"

		"por %%mm7, %%mm1		\n\t"

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t"

		"psubw %%mm3, %%mm1		\n\t"

		"pandn %%mm0, %%mm4		\n\t"

		"pandn %%mm1, %%mm5		\n\t"

		"movq %%mm4, (%0, %%eax)	\n\t"

		"movq %%mm5, 8(%0, %%eax)	\n\t"



		"addl $16, %%eax		\n\t"

		"js 1b				\n\t"

		::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)

		: "%eax", "memory"

	);    

        block[0]= block0;



        } else {

        quant_matrix = s->non_intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\n\t"

		"psrlw $15, %%mm7		\n\t"

		"movd %2, %%mm6			\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

		"packssdw %%mm6, %%mm6		\n\t"

                "movl %3, %%eax			\n\t"

		".balign 16\n\t"

		"1:				\n\t"

		"movq (%0, %%eax), %%mm0	\n\t"

		"movq 8(%0, %%eax), %%mm1	\n\t"

		"movq (%1, %%eax), %%mm4	\n\t"

		"movq 8(%1, %%eax), %%mm5	\n\t"

		"pmullw %%mm6, %%mm4		\n\t" 

		"pmullw %%mm6, %%mm5		\n\t" 

		"pxor %%mm2, %%mm2		\n\t"

		"pxor %%mm3, %%mm3		\n\t"

		"pcmpgtw %%mm0, %%mm2		\n\t" 

		"pcmpgtw %%mm1, %%mm3		\n\t" 

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t" 

		"psubw %%mm3, %%mm1		\n\t" 

		"paddw %%mm0, %%mm0		\n\t" *2

		"paddw %%mm1, %%mm1		\n\t" *2

		"paddw %%mm7, %%mm0		\n\t" *2 + 1

		"paddw %%mm7, %%mm1		\n\t" *2 + 1

		"pmullw %%mm4, %%mm0		\n\t" 

		"pmullw %%mm5, %%mm1		\n\t" 

		"pxor %%mm4, %%mm4		\n\t"

		"pxor %%mm5, %%mm5		\n\t" 

		"pcmpeqw (%0, %%eax), %%mm4	\n\t" 

		"pcmpeqw 8(%0, %%eax), %%mm5	\n\t" 

		"psraw $4, %%mm0		\n\t"

		"psraw $4, %%mm1		\n\t"

		"psubw %%mm7, %%mm0		\n\t"

		"psubw %%mm7, %%mm1		\n\t"

		"por %%mm7, %%mm0		\n\t"

		"por %%mm7, %%mm1		\n\t"

		"pxor %%mm2, %%mm0		\n\t"

		"pxor %%mm3, %%mm1		\n\t"

		"psubw %%mm2, %%mm0		\n\t"

		"psubw %%mm3, %%mm1		\n\t"

		"pandn %%mm0, %%mm4		\n\t"

		"pandn %%mm1, %%mm5		\n\t"

		"movq %%mm4, (%0, %%eax)	\n\t"

		"movq %%mm5, 8(%0, %%eax)	\n\t"



		"addl $16, %%eax		\n\t"

		"js 1b				\n\t"

		::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)

		: "%eax", "memory"

	);

    }

}

        quant_matrix = s->non_intra_matrix;         quant_matrix = s->non_intra_matrix; 	); 	);         } else {         } else {         } else {         quant_matrix = s->non_intra_matrix;         quant_matrix = s->non_intra_matrix;
static void FUNC_0(MpegEncContext *VAR_0,

                                     DCTELEM *VAR_1, int VAR_2, int VAR_3)

{

    int VAR_4;

    const UINT16 *VAR_5;

    

    if(VAR_0->alternate_scan) VAR_4= 64;

    else VAR_4= VAR_4= zigzag_end[ VAR_0->block_last_index[VAR_2] ];



    if (VAR_0->mb_intra) {

        int VAR_6;

        if (VAR_2 < 4) 

            VAR_6 = VAR_1[0] * VAR_0->y_dc_scale;

        else

            VAR_6 = VAR_1[0] * VAR_0->c_dc_scale;

        

        VAR_5 = VAR_0->intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\VAR_2\t"

		"psrlw $15, %%mm7		\VAR_2\t"

		"movd %2, %%mm6			\VAR_2\t"

		"packssdw %%mm6, %%mm6		\VAR_2\t"

		"packssdw %%mm6, %%mm6		\VAR_2\t"

                "movl %3, %%eax			\VAR_2\t"

		".balign 16\VAR_2\t"

		"1:				\VAR_2\t"

		"movq (%0, %%eax), %%mm0	\VAR_2\t"

		"movq 8(%0, %%eax), %%mm1	\VAR_2\t"

		"movq (%1, %%eax), %%mm4	\VAR_2\t"

		"movq 8(%1, %%eax), %%mm5	\VAR_2\t"

		"pmullw %%mm6, %%mm4		\VAR_2\t" 

		"pmullw %%mm6, %%mm5		\VAR_2\t" 

		"pxor %%mm2, %%mm2		\VAR_2\t"

		"pxor %%mm3, %%mm3		\VAR_2\t"

		"pcmpgtw %%mm0, %%mm2		\VAR_2\t" 

		"pcmpgtw %%mm1, %%mm3		\VAR_2\t" 

		"pxor %%mm2, %%mm0		\VAR_2\t"

		"pxor %%mm3, %%mm1		\VAR_2\t"

		"psubw %%mm2, %%mm0		\VAR_2\t" 

		"psubw %%mm3, %%mm1		\VAR_2\t" 

		"pmullw %%mm4, %%mm0		\VAR_2\t" *q

		"pmullw %%mm5, %%mm1		\VAR_2\t" *q

		"pxor %%mm4, %%mm4		\VAR_2\t"

		"pxor %%mm5, %%mm5		\VAR_2\t" 

		"pcmpeqw (%0, %%eax), %%mm4	\VAR_2\t" 

		"pcmpeqw 8(%0, %%eax), %%mm5	\VAR_2\t" 

		"psraw $3, %%mm0		\VAR_2\t"

		"psraw $3, %%mm1		\VAR_2\t"

		"psubw %%mm7, %%mm0		\VAR_2\t"

		"psubw %%mm7, %%mm1		\VAR_2\t"

		"por %%mm7, %%mm0		\VAR_2\t"

		"por %%mm7, %%mm1		\VAR_2\t"

		"pxor %%mm2, %%mm0		\VAR_2\t"

		"pxor %%mm3, %%mm1		\VAR_2\t"

		"psubw %%mm2, %%mm0		\VAR_2\t"

		"psubw %%mm3, %%mm1		\VAR_2\t"

		"pandn %%mm0, %%mm4		\VAR_2\t"

		"pandn %%mm1, %%mm5		\VAR_2\t"

		"movq %%mm4, (%0, %%eax)	\VAR_2\t"

		"movq %%mm5, 8(%0, %%eax)	\VAR_2\t"



		"addl $16, %%eax		\VAR_2\t"

		"js 1b				\VAR_2\t"

		::"r" (VAR_1+VAR_4), "r"(VAR_5+VAR_4), "g" (VAR_3), "g" (-2*VAR_4)

		: "%eax", "memory"

	);    

        VAR_1[0]= VAR_6;



        } else {

        VAR_5 = VAR_0->non_intra_matrix;

asm volatile(

		"pcmpeqw %%mm7, %%mm7		\VAR_2\t"

		"psrlw $15, %%mm7		\VAR_2\t"

		"movd %2, %%mm6			\VAR_2\t"

		"packssdw %%mm6, %%mm6		\VAR_2\t"

		"packssdw %%mm6, %%mm6		\VAR_2\t"

                "movl %3, %%eax			\VAR_2\t"

		".balign 16\VAR_2\t"

		"1:				\VAR_2\t"

		"movq (%0, %%eax), %%mm0	\VAR_2\t"

		"movq 8(%0, %%eax), %%mm1	\VAR_2\t"

		"movq (%1, %%eax), %%mm4	\VAR_2\t"

		"movq 8(%1, %%eax), %%mm5	\VAR_2\t"

		"pmullw %%mm6, %%mm4		\VAR_2\t" 

		"pmullw %%mm6, %%mm5		\VAR_2\t" 

		"pxor %%mm2, %%mm2		\VAR_2\t"

		"pxor %%mm3, %%mm3		\VAR_2\t"

		"pcmpgtw %%mm0, %%mm2		\VAR_2\t" 

		"pcmpgtw %%mm1, %%mm3		\VAR_2\t" 

		"pxor %%mm2, %%mm0		\VAR_2\t"

		"pxor %%mm3, %%mm1		\VAR_2\t"

		"psubw %%mm2, %%mm0		\VAR_2\t" 

		"psubw %%mm3, %%mm1		\VAR_2\t" 

		"paddw %%mm0, %%mm0		\VAR_2\t" *2

		"paddw %%mm1, %%mm1		\VAR_2\t" *2

		"paddw %%mm7, %%mm0		\VAR_2\t" *2 + 1

		"paddw %%mm7, %%mm1		\VAR_2\t" *2 + 1

		"pmullw %%mm4, %%mm0		\VAR_2\t" 

		"pmullw %%mm5, %%mm1		\VAR_2\t" 

		"pxor %%mm4, %%mm4		\VAR_2\t"

		"pxor %%mm5, %%mm5		\VAR_2\t" 

		"pcmpeqw (%0, %%eax), %%mm4	\VAR_2\t" 

		"pcmpeqw 8(%0, %%eax), %%mm5	\VAR_2\t" 

		"psraw $4, %%mm0		\VAR_2\t"

		"psraw $4, %%mm1		\VAR_2\t"

		"psubw %%mm7, %%mm0		\VAR_2\t"

		"psubw %%mm7, %%mm1		\VAR_2\t"

		"por %%mm7, %%mm0		\VAR_2\t"

		"por %%mm7, %%mm1		\VAR_2\t"

		"pxor %%mm2, %%mm0		\VAR_2\t"

		"pxor %%mm3, %%mm1		\VAR_2\t"

		"psubw %%mm2, %%mm0		\VAR_2\t"

		"psubw %%mm3, %%mm1		\VAR_2\t"

		"pandn %%mm0, %%mm4		\VAR_2\t"

		"pandn %%mm1, %%mm5		\VAR_2\t"

		"movq %%mm4, (%0, %%eax)	\VAR_2\t"

		"movq %%mm5, 8(%0, %%eax)	\VAR_2\t"



		"addl $16, %%eax		\VAR_2\t"

		"js 1b				\VAR_2\t"

		::"r" (VAR_1+VAR_4), "r"(VAR_5+VAR_4), "g" (VAR_3), "g" (-2*VAR_4)

		: "%eax", "memory"

	);

    }

}

static void FUNC_0(MpegEncContext *VAR_0,
DCTELEM *VAR_1, int VAR_2, int VAR_3)
{ int VAR_4; const UINT16 *VAR_5; if(VAR_0->alternate_scan) VAR_4= 64; else VAR_4= VAR_4= zigzag_end[ VAR_0->block_last_index[VAR_2] ]; if (VAR_0->mb_intra) { int VAR_6; if (VAR_2 < 4)
VAR_6 = VAR_1[0] * VAR_0->y_dc_scale; else
VAR_6 = VAR_1[0] * VAR_0->c_dc_scale; VAR_5 = VAR_0->intra_matrix; asm volatile(
"pcmpeqw %%mm7, %%mm7		\VAR_2\t"
"psrlw $15, %%mm7		\VAR_2\t"
"movd %2, %%mm6			\VAR_2\t"
"packssdw %%mm6, %%mm6		\VAR_2\t"
"packssdw %%mm6, %%mm6		\VAR_2\t"
"movl %3, %%eax			\VAR_2\t"
".balign 16\VAR_2\t"
"1:				\VAR_2\t"
"movq (%0, %%eax), %%mm0	\VAR_2\t"
"movq 8(%0, %%eax), %%mm1	\VAR_2\t"
"movq (%1, %%eax), %%mm4	\VAR_2\t"
"movq 8(%1, %%eax), %%mm5	\VAR_2\t"
"pmullw %%mm6, %%mm4		\VAR_2\t"
"pmullw %%mm6, %%mm5		\VAR_2\t"
"pxor %%mm2, %%mm2		\VAR_2\t"
"pxor %%mm3, %%mm3		\VAR_2\t"
"pcmpgtw %%mm0, %%mm2		\VAR_2\t"
"pcmpgtw %%mm1, %%mm3		\VAR_2\t"
"pxor %%mm2, %%mm0		\VAR_2\t"
"pxor %%mm3, %%mm1		\VAR_2\t"
"psubw %%mm2, %%mm0		\VAR_2\t"
"psubw %%mm3, %%mm1		\VAR_2\t"
"pmullw %%mm4, %%mm0		\VAR_2\t" *q
"pmullw %%mm5, %%mm1		\VAR_2\t" *q
"pxor %%mm4, %%mm4		\VAR_2\t"
"pxor %%mm5, %%mm5		\VAR_2\t"
"pcmpeqw (%0, %%eax), %%mm4	\VAR_2\t"
"pcmpeqw 8(%0, %%eax), %%mm5	\VAR_2\t"
"psraw $3, %%mm0		\VAR_2\t"
"psraw $3, %%mm1		\VAR_2\t"
"psubw %%mm7, %%mm0		\VAR_2\t"
"psubw %%mm7, %%mm1		\VAR_2\t"
"por %%mm7, %%mm0		\VAR_2\t"
"por %%mm7, %%mm1		\VAR_2\t"
"pxor %%mm2, %%mm0		\VAR_2\t"
"pxor %%mm3, %%mm1		\VAR_2\t"
"psubw %%mm2, %%mm0		\VAR_2\t"
"psubw %%mm3, %%mm1		\VAR_2\t"
"pandn %%mm0, %%mm4		\VAR_2\t"
"pandn %%mm1, %%mm5		\VAR_2\t"
"movq %%mm4, (%0, %%eax)	\VAR_2\t"
"movq %%mm5, 8(%0, %%eax)	\VAR_2\t"
"addl $16, %%eax		\VAR_2\t"
"js 1b				\VAR_2\t"
::"r" (VAR_1+VAR_4), "r"(VAR_5+VAR_4), "g" (VAR_3), "g" (-2*VAR_4)
: "%eax", "memory"
); VAR_1[0]= VAR_6; } else { VAR_5 = VAR_0->non_intra_matrix; asm volatile(
"pcmpeqw %%mm7, %%mm7		\VAR_2\t"
"psrlw $15, %%mm7		\VAR_2\t"
"movd %2, %%mm6			\VAR_2\t"
"packssdw %%mm6, %%mm6		\VAR_2\t"
"packssdw %%mm6, %%mm6		\VAR_2\t"
"movl %3, %%eax			\VAR_2\t"
".balign 16\VAR_2\t"
"1:				\VAR_2\t"
"movq (%0, %%eax), %%mm0	\VAR_2\t"
"movq 8(%0, %%eax), %%mm1	\VAR_2\t"
"movq (%1, %%eax), %%mm4	\VAR_2\t"
"movq 8(%1, %%eax), %%mm5	\VAR_2\t"
"pmullw %%mm6, %%mm4		\VAR_2\t"
"pmullw %%mm6, %%mm5		\VAR_2\t"
"pxor %%mm2, %%mm2		\VAR_2\t"
"pxor %%mm3, %%mm3		\VAR_2\t"
"pcmpgtw %%mm0, %%mm2		\VAR_2\t"
"pcmpgtw %%mm1, %%mm3		\VAR_2\t"
"pxor %%mm2, %%mm0		\VAR_2\t"
"pxor %%mm3, %%mm1		\VAR_2\t"
"psubw %%mm2, %%mm0		\VAR_2\t"
"psubw %%mm3, %%mm1		\VAR_2\t"
"paddw %%mm0, %%mm0		\VAR_2\t" *2
"paddw %%mm1, %%mm1		\VAR_2\t" *2
"paddw %%mm7, %%mm0		\VAR_2\t" *2 + 1
"paddw %%mm7, %%mm1		\VAR_2\t" *2 + 1
"pmullw %%mm4, %%mm0		\VAR_2\t"
"pmullw %%mm5, %%mm1		\VAR_2\t"
"pxor %%mm4, %%mm4		\VAR_2\t"
"pxor %%mm5, %%mm5		\VAR_2\t"
"pcmpeqw (%0, %%eax), %%mm4	\VAR_2\t"
"pcmpeqw 8(%0, %%eax), %%mm5	\VAR_2\t"
"psraw $4, %%mm0		\VAR_2\t"
"psraw $4, %%mm1		\VAR_2\t"
"psubw %%mm7, %%mm0		\VAR_2\t"
"psubw %%mm7, %%mm1		\VAR_2\t"
"por %%mm7, %%mm0		\VAR_2\t"
"por %%mm7, %%mm1		\VAR_2\t"
"pxor %%mm2, %%mm0		\VAR_2\t"
"pxor %%mm3, %%mm1		\VAR_2\t"
"psubw %%mm2, %%mm0		\VAR_2\t"
"psubw %%mm3, %%mm1		\VAR_2\t"
"pandn %%mm0, %%mm4		\VAR_2\t"
"pandn %%mm1, %%mm5		\VAR_2\t"
"movq %%mm4, (%0, %%eax)	\VAR_2\t"
"movq %%mm5, 8(%0, %%eax)	\VAR_2\t"
"addl $16, %%eax		\VAR_2\t"
"js 1b				\VAR_2\t"
::"r" (VAR_1+VAR_4), "r"(VAR_5+VAR_4), "g" (VAR_3), "g" (-2*VAR_4)
: "%eax", "memory"
); } }