static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)

{

	const uint8_t *s = src;

	const uint8_t *end;

#ifdef HAVE_MMX

	const uint8_t *mm_end;

#endif

	uint16_t *d = (uint16_t *)dst;

	end = s + src_size;

#ifdef HAVE_MMX

	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory");

	__asm __volatile(

	    "movq	%0, %%mm7\n\t"

	    "movq	%1, %%mm6\n\t"

	    ::"m"(red_16mask),"m"(green_16mask));

	mm_end = end - 15;

	while(s < mm_end)

	{

	    __asm __volatile(

		PREFETCH" 32%1\n\t"

		"movd	%1, %%mm0\n\t"

		"movd	4%1, %%mm3\n\t"

		"punpckldq 8%1, %%mm0\n\t"

		"punpckldq 12%1, %%mm3\n\t"

		"movq	%%mm0, %%mm1\n\t"

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

		"movq	%%mm3, %%mm4\n\t"

		"movq	%%mm3, %%mm5\n\t"

		"psllq	$8, %%mm0\n\t"

		"psllq	$8, %%mm3\n\t"

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

		"pand	%%mm7, %%mm3\n\t"

		"psrlq	$5, %%mm1\n\t"

		"psrlq	$5, %%mm4\n\t"

		"pand	%%mm6, %%mm1\n\t"

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

		"psrlq	$19, %%mm2\n\t"

		"psrlq	$19, %%mm5\n\t"

		"pand	%2, %%mm2\n\t"

		"pand	%2, %%mm5\n\t"

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

		"por	%%mm4, %%mm3\n\t"

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

		"por	%%mm5, %%mm3\n\t"

		"psllq	$16, %%mm3\n\t"

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

		MOVNTQ"	%%mm0, %0\n\t"

		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");

		d += 4;

		s += 16;

	}

	__asm __volatile(SFENCE:::"memory");

	__asm __volatile(EMMS:::"memory");

#endif

	while(s < end)

	{

		register int rgb = *(uint32_t*)s; s += 4;

		*d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19);

	}

}

static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)

{

	const uint8_t *s = src;

	const uint8_t *end;

#ifdef HAVE_MMX

	const uint8_t *mm_end;

#endif

	uint16_t *d = (uint16_t *)dst;

	end = s + src_size;

#ifdef HAVE_MMX

	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory");

	__asm __volatile(

	    "movq	%0, %%mm7\n\t"

	    "movq	%1, %%mm6\n\t"

	    ::"m"(red_16mask),"m"(green_16mask));

	mm_end = end - 15;

	while(s < mm_end)

	{

	    __asm __volatile(

		PREFETCH" 32%1\n\t"

		"movd	%1, %%mm0\n\t"

		"movd	4%1, %%mm3\n\t"

		"punpckldq 8%1, %%mm0\n\t"

		"punpckldq 12%1, %%mm3\n\t"

		"movq	%%mm0, %%mm1\n\t"

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

		"movq	%%mm3, %%mm4\n\t"

		"movq	%%mm3, %%mm5\n\t"

		"psllq	$8, %%mm0\n\t"

		"psllq	$8, %%mm3\n\t"

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

		"pand	%%mm7, %%mm3\n\t"

		"psrlq	$5, %%mm1\n\t"

		"psrlq	$5, %%mm4\n\t"

		"pand	%%mm6, %%mm1\n\t"

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

		"psrlq	$19, %%mm2\n\t"

		"psrlq	$19, %%mm5\n\t"

		"pand	%2, %%mm2\n\t"

		"pand	%2, %%mm5\n\t"

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

		"por	%%mm4, %%mm3\n\t"

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

		"por	%%mm5, %%mm3\n\t"

		"psllq	$16, %%mm3\n\t"

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

		MOVNTQ"	%%mm0, %0\n\t"

		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory");

		d += 4;

		s += 16;

	}

	__asm __volatile(SFENCE:::"memory");

	__asm __volatile(EMMS:::"memory");

#endif

	while(s < end)

	{

		register int rgb = *(uint32_t*)s; s += 4;

		*d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19);

	}

}

	while(s < end) 	while(s < end) 	while(s < end) 	while(s < end) #ifdef HAVE_MMX #endif #ifdef HAVE_MMX #endif #endif #endif 	__asm __volatile( 		"movq	%%mm0, %%mm1\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	__asm __volatile( 		"movq	%%mm0, %%mm1\n\t" 		"pand	%%mm7, %%mm0\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"por	%%mm1, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	mm_end = end - 15; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	    ::"m"(red_16mask),"m"(green_16mask)); 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movd	4%1, %%mm3\n\t" 		"punpckldq 8%1, %%mm0\n\t" 		"punpckldq 12%1, %%mm3\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"psrlq	$5, %%mm1\n\t" 		"psrlq	$5, %%mm4\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory"); 		d += 4; 		s += 16; #endif 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 		register int rgb = *(uint32_t*)s; s += 4; 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	    ::"m"(red_16mask),"m"(green_16mask)); 	mm_end = end - 15; 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movd	4%1, %%mm3\n\t" 		"punpckldq 8%1, %%mm0\n\t" 		"punpckldq 12%1, %%mm3\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"psllq	$8, %%mm0\n\t" 		"psllq	$8, %%mm3\n\t" 		"pand	%%mm7, %%mm0\n\t" 		"pand	%%mm7, %%mm3\n\t" 		"psrlq	$5, %%mm1\n\t" 		"psrlq	$5, %%mm4\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"psrlq	$19, %%mm2\n\t" 		"psrlq	$19, %%mm5\n\t" 		"pand	%2, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory"); 		d += 4; 		s += 16; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 		register int rgb = *(uint32_t*)s; s += 4; 		*d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19); 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	mm_end = end - 15; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movd	4%1, %%mm3\n\t" 		"punpckldq 8%1, %%mm0\n\t" 		"punpckldq 12%1, %%mm3\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		d += 4; 		s += 16; #endif 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 		register int rgb = *(uint32_t*)s; s += 4; 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	mm_end = end - 15; 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movd	4%1, %%mm3\n\t" 		"punpckldq 8%1, %%mm0\n\t" 		"punpckldq 12%1, %%mm3\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"pand	%%mm7, %%mm0\n\t" 		"pand	%%mm7, %%mm3\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"psrlq	$19, %%mm2\n\t" 		"psrlq	$19, %%mm5\n\t" 		"pand	%2, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		d += 4; 		s += 16; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 		register int rgb = *(uint32_t*)s; s += 4; 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	    ::"m"(red_16mask),"m"(green_16mask)); 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"psrlq	$5, %%mm1\n\t" 		"psrlq	$5, %%mm4\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory"); 		d += 4; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	    ::"m"(red_16mask),"m"(green_16mask)); 	mm_end = end - 15; 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"psllq	$8, %%mm0\n\t" 		"psllq	$8, %%mm3\n\t" 		"pand	%%mm7, %%mm0\n\t" 		"pand	%%mm7, %%mm3\n\t" 		"psrlq	$5, %%mm1\n\t" 		"psrlq	$5, %%mm4\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"psrlq	$19, %%mm2\n\t" 		"psrlq	$19, %%mm5\n\t" 		"pand	%2, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		:"=m"(*d):"m"(*s),"m"(blue_16mask):"memory"); 		d += 4; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		d += 4; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	const uint8_t *s = src; 	const uint8_t *end; 	const uint8_t *mm_end; 	uint16_t *d = (uint16_t *)dst; 	end = s + src_size; 	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); 	__asm __volatile( 	    "movq	%0, %%mm7\n\t" 	    "movq	%1, %%mm6\n\t" 	mm_end = end - 15; 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"movd	%1, %%mm0\n\t" 		"movq	%%mm0, %%mm1\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"movq	%%mm3, %%mm4\n\t" 		"movq	%%mm3, %%mm5\n\t" 		"pand	%%mm7, %%mm0\n\t" 		"pand	%%mm7, %%mm3\n\t" 		"pand	%%mm6, %%mm1\n\t" 		"pand	%%mm6, %%mm4\n\t" 		"psrlq	$19, %%mm2\n\t" 		"psrlq	$19, %%mm5\n\t" 		"pand	%2, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm5, %%mm3\n\t" 		"psllq	$16, %%mm3\n\t" 		"por	%%mm3, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 		d += 4; 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 	    __asm __volatile( 		"movq	%%mm3, %%mm5\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 	    __asm __volatile( 		"movq	%%mm3, %%mm5\n\t" 		"movq	%%mm0, %%mm2\n\t" 		"pand	%2, %%mm5\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	while(s < mm_end) 	    __asm __volatile( 		PREFETCH" 32%1\n\t" 		"por	%%mm1, %%mm0\n\t" 		"por	%%mm2, %%mm0\n\t" 		"por	%%mm4, %%mm3\n\t" 		"por	%%mm5, %%mm3\n\t" 		MOVNTQ"	%%mm0, %0\n\t" 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif 	while(s < end) 	__asm __volatile( #endif 	__asm __volatile(SFENCE:::"memory"); 	__asm __volatile(EMMS:::"memory"); #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif #endif 		PREFETCH" 32%1\n\t" 		MOVNTQ"	%%mm0, %0\n\t" #endif 		PREFETCH" 32%1\n\t" 		MOVNTQ"	%%mm0, %0\n\t" #endif #endif
static inline void FUNC_0(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)

{

	const uint8_t *VAR_0 = src;

	const uint8_t *VAR_1;

#ifdef HAVE_MMX

	const uint8_t *mm_end;

#endif

	uint16_t *d = (uint16_t *)dst;

	VAR_1 = VAR_0 + src_size;

#ifdef HAVE_MMX

	__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory");

	__asm __volatile(

	    "movq	%0, %%mm7\n\t"

	    "movq	%1, %%mm6\n\t"

	    ::"m"(red_16mask),"m"(green_16mask));

	mm_end = VAR_1 - 15;

	while(VAR_0 < mm_end)

	{

	    __asm __volatile(

		PREFETCH" 32%1\n\t"

		"movd	%1, %%mm0\n\t"

		"movd	4%1, %%mm3\n\t"

		"punpckldq 8%1, %%mm0\n\t"

		"punpckldq 12%1, %%mm3\n\t"

		"movq	%%mm0, %%mm1\n\t"

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

		"movq	%%mm3, %%mm4\n\t"

		"movq	%%mm3, %%mm5\n\t"

		"psllq	$8, %%mm0\n\t"

		"psllq	$8, %%mm3\n\t"

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

		"pand	%%mm7, %%mm3\n\t"

		"psrlq	$5, %%mm1\n\t"

		"psrlq	$5, %%mm4\n\t"

		"pand	%%mm6, %%mm1\n\t"

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

		"psrlq	$19, %%mm2\n\t"

		"psrlq	$19, %%mm5\n\t"

		"pand	%2, %%mm2\n\t"

		"pand	%2, %%mm5\n\t"

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

		"por	%%mm4, %%mm3\n\t"

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

		"por	%%mm5, %%mm3\n\t"

		"psllq	$16, %%mm3\n\t"

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

		MOVNTQ"	%%mm0, %0\n\t"

		:"=m"(*d):"m"(*VAR_0),"m"(blue_16mask):"memory");

		d += 4;

		VAR_0 += 16;

	}

	__asm __volatile(SFENCE:::"memory");

	__asm __volatile(EMMS:::"memory");

#endif

	while(VAR_0 < VAR_1)

	{

		register int VAR_2 = *(uint32_t*)VAR_0; VAR_0 += 4;

		*d++ = ((VAR_2&0xF8)<<8) + ((VAR_2&0xFC00)>>5) + ((VAR_2&0xF80000)>>19);

	}

}

static inline void FUNC_0(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)
{ const uint8_t *VAR_0 = src; const uint8_t *VAR_1; #ifdef HAVE_MMX
const uint8_t *mm_end; #endif
uint16_t *d = (uint16_t *)dst; VAR_1 = VAR_0 + src_size; #ifdef HAVE_MMX
__asm __volatile(PREFETCH"	%0"::"m"(*src):"memory"); __asm __volatile(
"movq	%0, %%mm7\n\t"
"movq	%1, %%mm6\n\t"
::"m"(red_16mask),"m"(green_16mask)); mm_end = VAR_1 - 15; while(VAR_0 < mm_end)
{ __asm __volatile(
PREFETCH" 32%1\n\t"
"movd	%1, %%mm0\n\t"
"movd	4%1, %%mm3\n\t"
"punpckldq 8%1, %%mm0\n\t"
"punpckldq 12%1, %%mm3\n\t"
"movq	%%mm0, %%mm1\n\t"
"movq	%%mm0, %%mm2\n\t"
"movq	%%mm3, %%mm4\n\t"
"movq	%%mm3, %%mm5\n\t"
"psllq	$8, %%mm0\n\t"
"psllq	$8, %%mm3\n\t"
"pand	%%mm7, %%mm0\n\t"
"pand	%%mm7, %%mm3\n\t"
"psrlq	$5, %%mm1\n\t"
"psrlq	$5, %%mm4\n\t"
"pand	%%mm6, %%mm1\n\t"
"pand	%%mm6, %%mm4\n\t"
"psrlq	$19, %%mm2\n\t"
"psrlq	$19, %%mm5\n\t"
"pand	%2, %%mm2\n\t"
"pand	%2, %%mm5\n\t"
"por	%%mm1, %%mm0\n\t"
"por	%%mm4, %%mm3\n\t"
"por	%%mm2, %%mm0\n\t"
"por	%%mm5, %%mm3\n\t"
"psllq	$16, %%mm3\n\t"
"por	%%mm3, %%mm0\n\t"
MOVNTQ"	%%mm0, %0\n\t"
:"=m"(*d):"m"(*VAR_0),"m"(blue_16mask):"memory"); d += 4; VAR_0 += 16; } __asm __volatile(SFENCE:::"memory"); __asm __volatile(EMMS:::"memory"); #endif
while(VAR_0 < VAR_1)
{ register int VAR_2 = *(uint32_t*)VAR_0; VAR_0 += 4; *d++ = ((VAR_2&0xF8)<<8) + ((VAR_2&0xFC00)>>5) + ((VAR_2&0xF80000)>>19); } }