user: What is the c source code of the assembly code below?

```asm
<redcode_ycbcr2rgb_halfscale>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,-0x30(%rsp)
  mov    %edx,-0x2c(%rsp)
  test   %edx,%edx
  jle    L85
  mov    %esi,%ebx
  test   %esi,%esi
  jle    L85
  mov    %rdi,%rax
  mov    %edx,%esi
  mov    %rcx,%rdi
  movslq %edx,%rcx
  mov    %ebx,%edx
  mov    %rcx,-0x28(%rsp)
  mov    0x8(%rax),%r11
  xor    %ebp,%ebp
  neg    %edx
  mov    0x10(%rax),%r10
  mov    0x18(%rax),%r9
  movq   $0x0,-0x40(%rsp)
  movslq %edx,%rcx
  lea    -0x1(%rsi),%edx
  mov    %ebx,%esi
  movl   $0x0,-0x34(%rsp)
  imul   %ebx,%edx
  mov    %rcx,-0x20(%rsp)
  movss  D41(%rip),%xmm0
  movss  D55(%rip),%xmm13
  movaps D55(%rip),%xmm4
  movss  D43(%rip),%xmm12
  movq   D97(%rip),%xmm11
  movslq %edx,%rbx
  movdqa D104(%rip),%xmm1
  movss  D109(%rip),%xmm10
  mov    %rbx,-0x48(%rsp)
  mov    (%rax),%rbx
  lea    -0x1(%rsi),%eax
  mov    %eax,-0x10(%rsp)
  mov    %esi,%eax
  and    $0xfffffffc,%esi
  movq   D104(%rip),%xmm7
  shr    $0x2,%eax
  mov    %esi,-0xc(%rsp)
  movaps D43(%rip),%xmm9
  lea    -0x1(%rax),%r15d
  mov    %esi,%eax
  movaps D109(%rip),%xmm8
  movdqa D15(%rip),%xmm5
  shl    $0x4,%rax
  add    $0x1,%r15
  mov    %rax,-0x18(%rsp)
  shl    $0x4,%r15
  nopl   0x0(%rax,%rax,1)
L81:
  mov    -0x48(%rsp),%rax
  cmpl   $0x2,-0x10(%rsp)
  lea    0x0(,%rax,4),%rdx
  lea    (%rdi,%rdx,1),%rax
  mov    %rax,%rsi
  jbe    L32
  mov    -0x40(%rsp),%rcx
  pxor   %xmm14,%xmm14
  lea    0x0(,%rcx,4),%r8
  lea    0xc(%rdi,%rdx,1),%rcx
  xor    %edx,%edx
  lea    (%rbx,%r8,1),%r14
  lea    (%r11,%r8,1),%r13
  lea    (%r10,%r8,1),%r12
  add    %r9,%r8
  nopw   0x0(%rax,%rax,1)
L73:
  movdqu (%r8,%rdx,1),%xmm6
  movdqu (%r14,%rdx,1),%xmm2
  add    $0x40,%rax
  movdqu (%r12,%rdx,1),%xmm3
  pand   %xmm1,%xmm6
  pand   %xmm1,%xmm2
  cvtdq2ps %xmm2,%xmm2
  cvtdq2ps %xmm6,%xmm6
  addps  %xmm2,%xmm6
  pand   %xmm1,%xmm3
  movdqu 0x0(%r13,%rdx,1),%xmm2
  paddd  %xmm5,%xmm3
  cvtdq2ps %xmm3,%xmm3
  mulps  %xmm4,%xmm3
  mulps  %xmm9,%xmm6
  pand   %xmm1,%xmm2
  paddd  %xmm5,%xmm2
  cvtdq2ps %xmm2,%xmm2
  mulps  %xmm4,%xmm2
  mulps  %xmm8,%xmm6
  addps  %xmm6,%xmm3
  movaps %xmm6,%xmm15
  addps  %xmm6,%xmm2
  addps  %xmm14,%xmm15
  movaps %xmm3,%xmm6
  movss  %xmm3,-0x40(%rax)
  shufps $0x55,%xmm3,%xmm6
  movss  %xmm6,-0x30(%rax)
  movaps %xmm3,%xmm6
  unpckhps %xmm3,%xmm6
  shufps $0xff,%xmm3,%xmm3
  movss  %xmm3,-0x10(%rax)
  movaps %xmm15,%xmm3
  shufps $0x55,%xmm15,%xmm3
  movss  %xmm3,-0x2c(%rax)
  movaps %xmm15,%xmm3
  unpckhps %xmm15,%xmm3
  movss  %xmm15,-0x3c(%rax)
  shufps $0xff,%xmm15,%xmm15
  movss  %xmm3,-0x1c(%rax)
  movaps %xmm2,%xmm3
  shufps $0x55,%xmm2,%xmm3
  movss  %xmm3,-0x28(%rax)
  movaps %xmm2,%xmm3
  unpckhps %xmm2,%xmm3
  movss  %xmm2,-0x38(%rax)
  shufps $0xff,%xmm2,%xmm2
  movss  %xmm6,-0x20(%rax)
  movss  %xmm15,-0xc(%rax)
  movss  %xmm3,-0x18(%rax)
  movss  %xmm2,-0x8(%rax)
  movss  %xmm0,(%rcx,%rdx,4)
  movss  %xmm0,0x10(%rcx,%rdx,4)
  movss  %xmm0,0x20(%rcx,%rdx,4)
  movss  %xmm0,0x30(%rcx,%rdx,4)
  add    $0x10,%rdx
  cmp    %r15,%rdx
  jne    L73
  mov    -0xc(%rsp),%eax
  add    -0x18(%rsp),%rsi
  mov    %eax,%edx
  cmp    %eax,-0x30(%rsp)
  je     L83
L88:
  mov    -0x30(%rsp),%r8d
  sub    %edx,%r8d
  cmp    $0x1,%r8d
  je     L64
  mov    -0x40(%rsp),%rcx
  mov    -0x48(%rsp),%r14
  mov    D55(%rip),%r13
  add    %rdx,%rcx
  lea    (%r14,%rdx,4),%rdx
  mov    D15(%rip),%r14
  movq   (%rbx,%rcx,4),%xmm2
  movq   (%r9,%rcx,4),%xmm3
  shl    $0x2,%rdx
  movq   %r14,%xmm15
  movq   %r14,%xmm6
  lea    0xc(%rdi,%rdx,1),%r12
  pand   %xmm7,%xmm2
  pand   %xmm7,%xmm3
  cvtdq2ps %xmm2,%xmm14
  cvtdq2ps %xmm3,%xmm3
  addps  %xmm3,%xmm14
  movq   D43(%rip),%xmm2
  movq   (%r10,%rcx,4),%xmm3
  mov    (%r11,%rcx,4),%rcx
  mulps  %xmm2,%xmm14
  pand   %xmm7,%xmm3
  movq   D109(%rip),%xmm2
  paddd  %xmm6,%xmm3
  movq   %r13,%xmm6
  cvtdq2ps %xmm3,%xmm3
  mulps  %xmm6,%xmm3
  xorps  %xmm6,%xmm6
  mulps  %xmm2,%xmm14
  movq   %rcx,%xmm2
  pand   %xmm7,%xmm2
  paddd  %xmm2,%xmm15
  cvtdq2ps %xmm15,%xmm2
  movq   %r13,%xmm15
  addps  %xmm14,%xmm3
  addps  %xmm14,%xmm6
  mulps  %xmm15,%xmm2
  movss  %xmm3,(%rdi,%rdx,1)
  shufps $0xe5,%xmm3,%xmm3
  movss  %xmm6,0x4(%rdi,%rdx,1)
  shufps $0xe5,%xmm6,%xmm6
  movss  %xmm3,0x10(%rdi,%rdx,1)
  addps  %xmm14,%xmm2
  movss  %xmm6,0x14(%rdi,%rdx,1)
  movss  %xmm2,0x8(%rdi,%rdx,1)
  shufps $0xe5,%xmm2,%xmm2
  movss  %xmm2,0x18(%rdi,%rdx,1)
  mov    %r8d,%edx
  and    $0xfffffffe,%edx
  movss  %xmm0,(%r12)
  mov    %edx,%ecx
  movss  %xmm0,0x10(%r12)
  add    %edx,%eax
  shl    $0x4,%rcx
  add    %rcx,%rsi
  cmp    %edx,%r8d
  je     L83
L64:
  pxor   %xmm3,%xmm3
  pxor   %xmm2,%xmm2
  pxor   %xmm6,%xmm6
  add    %ebp,%eax
  cltq
  pxor   %xmm14,%xmm14
  mov    (%r11,%rax,4),%edx
  and    $0xfff,%edx
  sub    $0x800,%edx
  cvtsi2ss %edx,%xmm3
  mov    (%rbx,%rax,4),%edx
  and    $0xfff,%edx
  cvtsi2ss %edx,%xmm2
  mov    (%r9,%rax,4),%edx
  mov    (%r10,%rax,4),%eax
  movss  %xmm0,0xc(%rsi)
  mulss  %xmm13,%xmm3
  and    $0xfff,%edx
  and    $0xfff,%eax
  cvtsi2ss %edx,%xmm6
  sub    $0x800,%eax
  addss  %xmm6,%xmm2
  pxor   %xmm6,%xmm6
  cvtsi2ss %eax,%xmm6
  mulss  %xmm12,%xmm2
  unpcklps %xmm2,%xmm6
  mulss  %xmm10,%xmm2
  mulps  %xmm11,%xmm6
  unpcklps %xmm14,%xmm2
  addps  %xmm6,%xmm2
  shufps $0xe5,%xmm6,%xmm6
  addss  %xmm6,%xmm3
  movlps %xmm2,(%rsi)
  movss  %xmm3,0x8(%rsi)
L83:
  addl   $0x1,-0x34(%rsp)
  mov    -0x2c(%rsp),%ecx
  mov    -0x34(%rsp),%eax
  mov    -0x28(%rsp),%rdx
  add    %ecx,%ebp
  add    %rdx,-0x40(%rsp)
  mov    -0x20(%rsp),%rdx
  add    %rdx,-0x48(%rsp)
  cmp    %eax,%ecx
  jne    L81
L85:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L88
```

tool_calls: name: retrieve_data
arguments: label: D41
type_infered: f32
name: retrieve_data
arguments: label: D55
type_infered: byte[16]
name: retrieve_data
arguments: label: D43
type_infered: byte[16]
name: retrieve_data
arguments: label: D97
type_infered: byte[8]
name: retrieve_data
arguments: label: D104
type_infered: byte[16]
name: retrieve_data
arguments: label: D109
type_infered: byte[16]
name: retrieve_data
arguments: label: D15
type_infered: byte[16]

tool: D41: 1

tool: {"D55": [0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x3a]}

tool: {"D43": [0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x3f]}

tool: {"D97": [0x00,0x00,0x00,0x3a,0x00,0x00,0x80,0x39]}

tool: {"D104": [0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00,0xff,0x0f,0x00,0x00]}

tool: {"D109": [0x00,0x00,0x80,0x39,0x00,0x00,0x80,0x39,0x00,0x00,0x80,0x39,0x00,0x00,0x80,0x39]}

tool: {"D15": [0x00,0xf8,0xff,0xff,0x00,0xf8,0xff,0xff,0x00,0xf8,0xff,0xff,0x00,0xf8,0xff,0xff]}

assistant: ```c
void redcode_ycbcr2rgb_halfscale(int **planes, int width, int height, float *out) {
  int x, y;
  int pix_max = 4096;
  int mask = pix_max - 1;
  for (y = 0; y < height; y++) {
    float *o = out + width * (height - y - 1);
    for (x = 0; x < width; x++) {
      int i = y * height + x;
      float y1 = (planes[0][i] & mask);
      float cb = (planes[1][i] & mask) - pix_max / 2;
      float cr = (planes[2][i] & mask) - pix_max / 2;
      float y2 = (planes[3][i] & mask);
      float b_ = cb / (pix_max / 2);
      float r_ = cr / (pix_max / 2);
      float g_ = 0.0;
      float y = (y1 + y2) / 2 / pix_max;
      *o++ = r_ + y;
      *o++ = g_ + y;
      *o++ = b_ + y;
      *o++ = 1.0;
    }
  }
}
```