// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dsp/yuv_sse2.c
// Function: ConvertRGBA32ToUV_SSE2
static void ConvertRGBA32ToUV_SSE2(const uint16_t* rgb,
                                   uint8_t* u, uint8_t* v, int width) {
  const int max_width = width & ~15;
  const uint16_t* const last_rgb = rgb + 4 * max_width;
  while (rgb < last_rgb) {
    __m128i r, g, b, U0, V0, U1, V1;
    RGBA32PackedToPlanar_16b_SSE2(rgb +  0, &r, &g, &b);
    ConvertRGBToUV_SSE2(&r, &g, &b, &U0, &V0);
    RGBA32PackedToPlanar_16b_SSE2(rgb + 32, &r, &g, &b);
    ConvertRGBToUV_SSE2(&r, &g, &b, &U1, &V1);
    STORE_16(_mm_packus_epi16(U0, U1), u);
    STORE_16(_mm_packus_epi16(V0, V1), v);
    u += 16;
    v += 16;
    rgb += 2 * 32;
  }
  if (max_width < width) {  // left-over
    WebPConvertRGBA32ToUV_C(rgb, u, v, width - max_width);
  }
}

// Assembly:
movl %ecx, %eax
andl $-0x10, %eax
jle 0xf084d
leal (,%rax,4), %r8d
movslq %r8d, %r8
leaq (%rdi,%r8,2), %r8
movdqa 0x3df59(%rip), %xmm0    # 0x12e570
movdqa 0x3df61(%rip), %xmm1    # 0x12e580
movdqa 0x3df69(%rip), %xmm2    # 0x12e590
movdqa 0x3df71(%rip), %xmm3    # 0x12e5a0
movdqa 0x3df79(%rip), %xmm4    # 0x12e5b0
movdqu (%rdi), %xmm5
movdqu 0x10(%rdi), %xmm6
movdqu 0x20(%rdi), %xmm7
movdqu 0x30(%rdi), %xmm10
movdqa %xmm5, %xmm11
punpcklwd %xmm6, %xmm11   # xmm11 = xmm11[0],xmm6[0],xmm11[1],xmm6[1],xmm11[2],xmm6[2],xmm11[3],xmm6[3]
movdqa %xmm5, %xmm8
punpckhwd %xmm6, %xmm8    # xmm8 = xmm8[4],xmm6[4],xmm8[5],xmm6[5],xmm8[6],xmm6[6],xmm8[7],xmm6[7]
movdqa %xmm7, %xmm12
punpcklwd %xmm10, %xmm12  # xmm12 = xmm12[0],xmm10[0],xmm12[1],xmm10[1],xmm12[2],xmm10[2],xmm12[3],xmm10[3]
movdqa %xmm7, %xmm9
punpckhwd %xmm10, %xmm9   # xmm9 = xmm9[4],xmm10[4],xmm9[5],xmm10[5],xmm9[6],xmm10[6],xmm9[7],xmm10[7]
movdqa %xmm11, %xmm13
punpcklwd %xmm8, %xmm13   # xmm13 = xmm13[0],xmm8[0],xmm13[1],xmm8[1],xmm13[2],xmm8[2],xmm13[3],xmm8[3]
punpckhwd %xmm8, %xmm11   # xmm11 = xmm11[4],xmm8[4],xmm11[5],xmm8[5],xmm11[6],xmm8[6],xmm11[7],xmm8[7]
movdqa %xmm12, %xmm8
punpcklwd %xmm9, %xmm8    # xmm8 = xmm8[0],xmm9[0],xmm8[1],xmm9[1],xmm8[2],xmm9[2],xmm8[3],xmm9[3]
punpckhwd %xmm9, %xmm12   # xmm12 = xmm12[4],xmm9[4],xmm12[5],xmm9[5],xmm12[6],xmm9[6],xmm12[7],xmm9[7]
pshufd $0xee, %xmm13, %xmm9    # xmm9 = xmm13[2,3,2,3]
punpcklwd %xmm11, %xmm9   # xmm9 = xmm9[0],xmm11[0],xmm9[1],xmm11[1],xmm9[2],xmm11[2],xmm9[3],xmm11[3]
shufps $0x88, %xmm6, %xmm5     # xmm5 = xmm5[0,2],xmm6[0,2]
shufps $0x88, %xmm10, %xmm7    # xmm7 = xmm7[0,2],xmm10[0,2]
pshufd $0x44, %xmm12, %xmm6    # xmm6 = xmm12[0,1,0,1]
punpckhwd %xmm6, %xmm8    # xmm8 = xmm8[4],xmm6[4],xmm8[5],xmm6[5],xmm8[6],xmm6[6],xmm8[7],xmm6[7]
movaps %xmm5, %xmm6
pmaddwd %xmm0, %xmm6
movaps %xmm7, %xmm10
pmaddwd %xmm0, %xmm10
movdqa %xmm9, %xmm11
pmaddwd %xmm1, %xmm11
movdqa %xmm8, %xmm12
pmaddwd %xmm1, %xmm12
paddd %xmm2, %xmm6
paddd %xmm11, %xmm6
paddd %xmm2, %xmm10
paddd %xmm12, %xmm10
psrad $0x12, %xmm6
psrad $0x12, %xmm10
packssdw %xmm10, %xmm6
pmaddwd %xmm3, %xmm5
pmaddwd %xmm3, %xmm7
pmaddwd %xmm4, %xmm9
pmaddwd %xmm4, %xmm8
paddd %xmm2, %xmm5
paddd %xmm9, %xmm5
paddd %xmm2, %xmm7
paddd %xmm8, %xmm7
psrad $0x12, %xmm5
psrad $0x12, %xmm7
packssdw %xmm7, %xmm5
movdqu 0x40(%rdi), %xmm7
movdqu 0x50(%rdi), %xmm11
movdqu 0x60(%rdi), %xmm8
movdqu 0x70(%rdi), %xmm12
movdqa %xmm7, %xmm13
punpcklwd %xmm11, %xmm13  # xmm13 = xmm13[0],xmm11[0],xmm13[1],xmm11[1],xmm13[2],xmm11[2],xmm13[3],xmm11[3]
movdqa %xmm7, %xmm9
punpckhwd %xmm11, %xmm9   # xmm9 = xmm9[4],xmm11[4],xmm9[5],xmm11[5],xmm9[6],xmm11[6],xmm9[7],xmm11[7]
movdqa %xmm8, %xmm14
punpcklwd %xmm12, %xmm14  # xmm14 = xmm14[0],xmm12[0],xmm14[1],xmm12[1],xmm14[2],xmm12[2],xmm14[3],xmm12[3]
movdqa %xmm8, %xmm10
punpckhwd %xmm12, %xmm10  # xmm10 = xmm10[4],xmm12[4],xmm10[5],xmm12[5],xmm10[6],xmm12[6],xmm10[7],xmm12[7]
movdqa %xmm13, %xmm15
punpcklwd %xmm9, %xmm15   # xmm15 = xmm15[0],xmm9[0],xmm15[1],xmm9[1],xmm15[2],xmm9[2],xmm15[3],xmm9[3]
punpckhwd %xmm9, %xmm13   # xmm13 = xmm13[4],xmm9[4],xmm13[5],xmm9[5],xmm13[6],xmm9[6],xmm13[7],xmm9[7]
movdqa %xmm14, %xmm9
punpcklwd %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0],xmm9[1],xmm10[1],xmm9[2],xmm10[2],xmm9[3],xmm10[3]
punpckhwd %xmm10, %xmm14  # xmm14 = xmm14[4],xmm10[4],xmm14[5],xmm10[5],xmm14[6],xmm10[6],xmm14[7],xmm10[7]
pshufd $0xee, %xmm15, %xmm10   # xmm10 = xmm15[2,3,2,3]
punpcklwd %xmm13, %xmm10  # xmm10 = xmm10[0],xmm13[0],xmm10[1],xmm13[1],xmm10[2],xmm13[2],xmm10[3],xmm13[3]
shufps $0x88, %xmm11, %xmm7    # xmm7 = xmm7[0,2],xmm11[0,2]
shufps $0x88, %xmm12, %xmm8    # xmm8 = xmm8[0,2],xmm12[0,2]
pshufd $0x44, %xmm14, %xmm11   # xmm11 = xmm14[0,1,0,1]
punpckhwd %xmm11, %xmm9   # xmm9 = xmm9[4],xmm11[4],xmm9[5],xmm11[5],xmm9[6],xmm11[6],xmm9[7],xmm11[7]
movaps %xmm7, %xmm11
pmaddwd %xmm0, %xmm11
movaps %xmm8, %xmm12
pmaddwd %xmm0, %xmm12
movdqa %xmm10, %xmm13
pmaddwd %xmm1, %xmm13
movdqa %xmm9, %xmm14
pmaddwd %xmm1, %xmm14
paddd %xmm2, %xmm11
paddd %xmm13, %xmm11
paddd %xmm2, %xmm12
paddd %xmm14, %xmm12
psrad $0x12, %xmm11
psrad $0x12, %xmm12
packssdw %xmm12, %xmm11
packuswb %xmm11, %xmm6
pmaddwd %xmm3, %xmm7
pmaddwd %xmm3, %xmm8
pmaddwd %xmm4, %xmm10
pmaddwd %xmm4, %xmm9
paddd %xmm2, %xmm7
paddd %xmm10, %xmm7
paddd %xmm2, %xmm8
paddd %xmm9, %xmm8
psrad $0x12, %xmm7
psrad $0x12, %xmm8
packssdw %xmm8, %xmm7
packuswb %xmm7, %xmm5
movdqu %xmm6, (%rsi)
movdqu %xmm5, (%rdx)
addq $0x10, %rsi
addq $0x10, %rdx
subq $-0x80, %rdi
cmpq %r8, %rdi
jb 0xf0637
cmpl %ecx, %eax
jne 0xf0852
retq
andl $0xf, %ecx
jmp 0xe174e
nop