// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/libraries/libwebp/src/dsp/yuv_sse2.c
// Function: YuvToRgbaRow_SSE2
static void YuvToRgbaRow_SSE2(const uint8_t* y,
                              const uint8_t* u, const uint8_t* v,
                              uint8_t* dst, int len) {
  const __m128i kAlpha = _mm_set1_epi16(255);
  int n;
  for (n = 0; n + 8 <= len; n += 8, dst += 32) {
    __m128i R, G, B;
    YUV420ToRGB_SSE2(y, u, v, &R, &G, &B);
    PackAndStore4_SSE2(&R, &G, &B, &kAlpha, dst);
    y += 8;
    u += 4;
    v += 4;
  }
  for (; n < len; ++n) {   // Finish off
    VP8YuvToRgba(y[0], u[0], v[0], dst);
    dst += 4;
    y += 1;
    u += (n & 1);
    v += (n & 1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %eax, %eax
cmpl $0x8, %r8d
jl 0xedee6
movl %r8d, %eax
andl $0x7ffffff8, %eax       # imm = 0x7FFFFFF8
movl $0x8, %r9d
pxor %xmm0, %xmm0
movdqa 0x3eef9(%rip), %xmm1    # 0x12cc50
movdqa 0x3f961(%rip), %xmm2    # 0x12d6c0
movdqa 0x3f969(%rip), %xmm3    # 0x12d6d0
movdqa 0x3f971(%rip), %xmm4    # 0x12d6e0
movdqa 0x3f979(%rip), %xmm5    # 0x12d6f0
movdqa 0x3f981(%rip), %xmm6    # 0x12d700
movdqa 0x3f989(%rip), %xmm7    # 0x12d710
movdqa 0x3f990(%rip), %xmm8    # 0x12d720
movdqa 0x3f997(%rip), %xmm9    # 0x12d730
movdqa 0x3f0fe(%rip), %xmm10   # 0x12cea0
movq (%rdi), %xmm11
pxor %xmm12, %xmm12
punpcklbw %xmm11, %xmm12  # xmm12 = xmm12[0],xmm11[0],xmm12[1],xmm11[1],xmm12[2],xmm11[2],xmm12[3],xmm11[3],xmm12[4],xmm11[4],xmm12[5],xmm11[5],xmm12[6],xmm11[6],xmm12[7],xmm11[7]
movdqa %xmm12, %xmm13
punpckhbw %xmm0, %xmm13   # xmm13 = xmm13[8],xmm0[8],xmm13[9],xmm0[9],xmm13[10],xmm0[10],xmm13[11],xmm0[11],xmm13[12],xmm0[12],xmm13[13],xmm0[13],xmm13[14],xmm0[14],xmm13[15],xmm0[15]
punpcklbw %xmm0, %xmm12   # xmm12 = xmm12[0],xmm0[0],xmm12[1],xmm0[1],xmm12[2],xmm0[2],xmm12[3],xmm0[3],xmm12[4],xmm0[4],xmm12[5],xmm0[5],xmm12[6],xmm0[6],xmm12[7],xmm0[7]
pshufd $0x6c, %xmm12, %xmm11   # xmm11 = xmm12[0,3,2,1]
pshufhw $0xc4, %xmm11, %xmm11   # xmm11 = xmm11[0,1,2,3,4,5,4,7]
pshufd $0x6c, %xmm11, %xmm11   # xmm11 = xmm11[0,3,2,1]
pand %xmm1, %xmm11
packuswb %xmm13, %xmm11
pmulhuw %xmm2, %xmm11
movd (%rsi), %xmm12
pxor %xmm13, %xmm13
punpcklbw %xmm12, %xmm13  # xmm13 = xmm13[0],xmm12[0],xmm13[1],xmm12[1],xmm13[2],xmm12[2],xmm13[3],xmm12[3],xmm13[4],xmm12[4],xmm13[5],xmm12[5],xmm13[6],xmm12[6],xmm13[7],xmm12[7]
punpcklbw %xmm0, %xmm13   # xmm13 = xmm13[0],xmm0[0],xmm13[1],xmm0[1],xmm13[2],xmm0[2],xmm13[3],xmm0[3],xmm13[4],xmm0[4],xmm13[5],xmm0[5],xmm13[6],xmm0[6],xmm13[7],xmm0[7]
pshufd $0xfa, %xmm13, %xmm14   # xmm14 = xmm13[2,2,3,3]
pshufd $0x68, %xmm13, %xmm12   # xmm12 = xmm13[0,2,2,1]
pshuflw $0x64, %xmm12, %xmm12   # xmm12 = xmm12[0,1,2,1,4,5,6,7]
pshufhw $0xcc, %xmm12, %xmm12   # xmm12 = xmm12[0,1,2,3,4,7,4,7]
packuswb %xmm14, %xmm12
movd (%rdx), %xmm13
pxor %xmm14, %xmm14
punpcklbw %xmm13, %xmm14  # xmm14 = xmm14[0],xmm13[0],xmm14[1],xmm13[1],xmm14[2],xmm13[2],xmm14[3],xmm13[3],xmm14[4],xmm13[4],xmm14[5],xmm13[5],xmm14[6],xmm13[6],xmm14[7],xmm13[7]
punpcklbw %xmm0, %xmm14   # xmm14 = xmm14[0],xmm0[0],xmm14[1],xmm0[1],xmm14[2],xmm0[2],xmm14[3],xmm0[3],xmm14[4],xmm0[4],xmm14[5],xmm0[5],xmm14[6],xmm0[6],xmm14[7],xmm0[7]
pshufd $0xfa, %xmm14, %xmm13   # xmm13 = xmm14[2,2,3,3]
pshufd $0x68, %xmm14, %xmm14   # xmm14 = xmm14[0,2,2,1]
pshuflw $0x64, %xmm14, %xmm14   # xmm14 = xmm14[0,1,2,1,4,5,6,7]
pshufhw $0xcc, %xmm14, %xmm14   # xmm14 = xmm14[0,1,2,3,4,7,4,7]
packuswb %xmm13, %xmm14
movdqa %xmm14, %xmm13
pmulhuw %xmm3, %xmm13
paddw %xmm11, %xmm13
paddw %xmm4, %xmm13
movdqa %xmm12, %xmm15
pmulhuw %xmm5, %xmm15
pmulhuw %xmm6, %xmm14
paddw %xmm15, %xmm14
pmulhuw %xmm8, %xmm12
paddusw %xmm11, %xmm12
psubw %xmm14, %xmm11
paddw %xmm7, %xmm11
psubusw %xmm9, %xmm12
psraw $0x6, %xmm13
psraw $0x6, %xmm11
packuswb %xmm10, %xmm11
psrlw $0x6, %xmm12
packuswb %xmm12, %xmm13
movdqa %xmm13, %xmm12
punpcklbw %xmm11, %xmm12  # xmm12 = xmm12[0],xmm11[0],xmm12[1],xmm11[1],xmm12[2],xmm11[2],xmm12[3],xmm11[3],xmm12[4],xmm11[4],xmm12[5],xmm11[5],xmm12[6],xmm11[6],xmm12[7],xmm11[7]
punpckhbw %xmm11, %xmm13  # xmm13 = xmm13[8],xmm11[8],xmm13[9],xmm11[9],xmm13[10],xmm11[10],xmm13[11],xmm11[11],xmm13[12],xmm11[12],xmm13[13],xmm11[13],xmm13[14],xmm11[14],xmm13[15],xmm11[15]
movdqa %xmm12, %xmm11
punpcklwd %xmm13, %xmm11  # xmm11 = xmm11[0],xmm13[0],xmm11[1],xmm13[1],xmm11[2],xmm13[2],xmm11[3],xmm13[3]
punpckhwd %xmm13, %xmm12  # xmm12 = xmm12[4],xmm13[4],xmm12[5],xmm13[5],xmm12[6],xmm13[6],xmm12[7],xmm13[7]
movdqu %xmm11, (%rcx)
movdqu %xmm12, 0x10(%rcx)
addq $0x8, %rdi
addq $0x4, %rsi
addq $0x4, %rdx
addq $0x20, %rcx
addl $0x8, %r9d
cmpl %r8d, %r9d
jle 0xedda2
subl %eax, %r8d
jle 0xedfe4
movl %eax, %eax
movl $0x4000, %r9d           # imm = 0x4000
xorl %r10d, %r10d
leal (%rax,%r10), %r11d
movzbl (%rdi,%r10), %ebx
movzbl (%rsi), %ebp
movzbl (%rdx), %r14d
imull $0x4a85, %ebx, %ebx     # imm = 0x4A85
shrl $0x8, %ebx
imull $0x6625, %r14d, %r15d   # imm = 0x6625
shrl $0x8, %r15d
addl %ebx, %r15d
subl $0x379a, %r15d          # imm = 0x379A
movl $0x0, %r12d
adcb $-0x1, %r12b
movl %r15d, %r13d
shrl $0x6, %r13d
cmpl %r9d, %r15d
movzbl %r12b, %r15d
cmovbl %r13d, %r15d
movb %r15b, (%rcx,%r10,4)
imull $0x1913, %ebp, %r15d    # imm = 0x1913
shrl $0x8, %r15d
imull $0x3408, %r14d, %r14d   # imm = 0x3408
shrl $0x8, %r14d
addl %r15d, %r14d
movl %ebx, %r15d
subl %r14d, %r15d
negl %r14d
addl %ebx, %r14d
addl $0x2204, %r14d          # imm = 0x2204
movl %r14d, %r12d
shrl $0x6, %r12d
cmpl $0xffffddfc, %r15d      # imm = 0xFFFFDDFC
setge %r15b
negb %r15b
cmpl %r9d, %r14d
movzbl %r15b, %r14d
cmovbl %r12d, %r14d
imull $0x811a, %ebp, %ebp     # imm = 0x811A
shrl $0x8, %ebp
addl %ebx, %ebp
subl $0x4515, %ebp           # imm = 0x4515
movl $0x0, %ebx
adcb $-0x1, %bl
movl %ebp, %r15d
shrl $0x6, %r15d
cmpl %r9d, %ebp
movzbl %bl, %ebx
cmovbl %r15d, %ebx
movb %r14b, 0x1(%rcx,%r10,4)
movb %bl, 0x2(%rcx,%r10,4)
movb $-0x1, 0x3(%rcx,%r10,4)
andl $0x1, %r11d
addq %r11, %rsi
addq %r11, %rdx
incq %r10
cmpl %r10d, %r8d
jne 0xedefa
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq