// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/yuv_sse2.c
// Function: YuvToRgbRow_SSE2
static void YuvToRgbRow_SSE2(const uint8_t* y,
                             const uint8_t* u, const uint8_t* v,
                             uint8_t* dst, int len) {
  int n;
  for (n = 0; n + 32 <= len; n += 32, dst += 32 * 3) {
    __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3;
    __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5;

    YUV420ToRGB_SSE2(y +  0, u +  0, v +  0, &R0, &G0, &B0);
    YUV420ToRGB_SSE2(y +  8, u +  4, v +  4, &R1, &G1, &B1);
    YUV420ToRGB_SSE2(y + 16, u +  8, v +  8, &R2, &G2, &B2);
    YUV420ToRGB_SSE2(y + 24, u + 12, v + 12, &R3, &G3, &B3);

    // Cast to 8b and store as RRRRGGGGBBBB.
    rgb0 = _mm_packus_epi16(R0, R1);
    rgb1 = _mm_packus_epi16(R2, R3);
    rgb2 = _mm_packus_epi16(G0, G1);
    rgb3 = _mm_packus_epi16(G2, G3);
    rgb4 = _mm_packus_epi16(B0, B1);
    rgb5 = _mm_packus_epi16(B2, B3);

    // Pack as RGBRGBRGBRGB.
    PlanarTo24b_SSE2(&rgb0, &rgb1, &rgb2, &rgb3, &rgb4, &rgb5, dst);

    y += 32;
    u += 16;
    v += 16;
  }
  for (; n < len; ++n) {   // Finish off
    VP8YuvToRgb(y[0], u[0], v[0], dst);
    dst += 3;
    y += 1;
    u += (n & 1);
    v += (n & 1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0xc8(%rbp)
movq %rsi, -0xd0(%rbp)
movq %rdx, -0xd8(%rbp)
movq %rcx, -0xe0(%rbp)
movl %r8d, -0xe4(%rbp)
movl $0x0, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
addl $0x20, %eax
cmpl -0xe4(%rbp), %eax
jg 0x17c3bb
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x100(%rbp), %rcx
leaq -0x140(%rbp), %r8
leaq -0x180(%rbp), %r9
callq 0x17fbf0
movq -0xc8(%rbp), %rdi
addq $0x8, %rdi
movq -0xd0(%rbp), %rsi
addq $0x4, %rsi
movq -0xd8(%rbp), %rdx
addq $0x4, %rdx
leaq -0x110(%rbp), %rcx
leaq -0x150(%rbp), %r8
leaq -0x190(%rbp), %r9
callq 0x17fbf0
movq -0xc8(%rbp), %rdi
addq $0x10, %rdi
movq -0xd0(%rbp), %rsi
addq $0x8, %rsi
movq -0xd8(%rbp), %rdx
addq $0x8, %rdx
leaq -0x120(%rbp), %rcx
leaq -0x160(%rbp), %r8
leaq -0x1a0(%rbp), %r9
callq 0x17fbf0
movq -0xc8(%rbp), %rdi
addq $0x18, %rdi
movq -0xd0(%rbp), %rsi
addq $0xc, %rsi
movq -0xd8(%rbp), %rdx
addq $0xc, %rdx
leaq -0x130(%rbp), %rcx
leaq -0x170(%rbp), %r8
leaq -0x1b0(%rbp), %r9
callq 0x17fbf0
movdqa -0x100(%rbp), %xmm1
movdqa -0x110(%rbp), %xmm0
movdqa %xmm1, -0x10(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x10(%rbp), %xmm0
movdqa -0x20(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x1c0(%rbp)
movdqa -0x120(%rbp), %xmm1
movdqa -0x130(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
movdqa -0x40(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x1d0(%rbp)
movdqa -0x140(%rbp), %xmm1
movdqa -0x150(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm0
movdqa -0x60(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x1e0(%rbp)
movdqa -0x160(%rbp), %xmm1
movdqa -0x170(%rbp), %xmm0
movdqa %xmm1, -0x70(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x70(%rbp), %xmm0
movdqa -0x80(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x1f0(%rbp)
movdqa -0x180(%rbp), %xmm1
movdqa -0x190(%rbp), %xmm0
movdqa %xmm1, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0x90(%rbp), %xmm0
movdqa -0xa0(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x200(%rbp)
movdqa -0x1a0(%rbp), %xmm1
movdqa -0x1b0(%rbp), %xmm0
movdqa %xmm1, -0xb0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xb0(%rbp), %xmm0
movdqa -0xc0(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x210(%rbp)
movq -0xe0(%rbp), %rax
leaq -0x1c0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
leaq -0x1f0(%rbp), %rcx
leaq -0x200(%rbp), %r8
leaq -0x210(%rbp), %r9
movq %rax, (%rsp)
callq 0x17bc50
movq -0xc8(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xc8(%rbp)
movq -0xd0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xd0(%rbp)
movq -0xd8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xd8(%rbp)
movl -0xe8(%rbp), %eax
addl $0x20, %eax
movl %eax, -0xe8(%rbp)
movq -0xe0(%rbp), %rax
addq $0x60, %rax
movq %rax, -0xe0(%rbp)
jmp 0x17c0f8
jmp 0x17c3bd
movl -0xe8(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x17c46b
movq -0xc8(%rbp), %rax
movzbl (%rax), %edi
movq -0xd0(%rbp), %rax
movzbl (%rax), %esi
movq -0xd8(%rbp), %rax
movzbl (%rax), %edx
movq -0xe0(%rbp), %rcx
callq 0x17fc60
movq -0xe0(%rbp), %rax
addq $0x3, %rax
movq %rax, -0xe0(%rbp)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
movl -0xe8(%rbp), %ecx
andl $0x1, %ecx
movq -0xd0(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movl -0xe8(%rbp), %ecx
andl $0x1, %ecx
movq -0xd8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x17c3bd
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)