user: Please show me the C implementation that matches the assembly code listed below:

```asm
<colormatrix>:
  endbr64
  mov    %rcx,%rax
  imul   %edx,%esi
  lea    0x0(,%rsi,4),%ecx
  movslq %ecx,%rcx
  add    %rdi,%rcx
  cmp    %rcx,%rdi
  jae    L35
  push   %rbx
  mov    $0xff,%r11d
  pxor   %xmm7,%xmm7
  mov    $0x0,%esi
  mov    $0xff00,%r10d
  movaps %xmm7,%xmm6
  mov    $0xff0000,%r9d
  movaps %xmm7,%xmm5
  mov    $0xff000000,%r8d
  movaps %xmm7,%xmm4
  jmp    L48
L108:
  cvttss2si %xmm0,%ebx
  shl    $0x18,%ebx
L21:
  or     %ebx,%edx
  mov    %edx,(%rdi)
  add    $0x4,%rdi
  cmp    %rdi,%rcx
  jbe    L64
L48:
  movzbl (%rdi),%edx
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  movzbl 0x1(%rdi),%edx
  pxor   %xmm10,%xmm10
  cvtsi2ss %edx,%xmm10
  movzbl 0x2(%rdi),%edx
  pxor   %xmm9,%xmm9
  cvtsi2ss %edx,%xmm9
  movzbl 0x3(%rdi),%edx
  pxor   %xmm8,%xmm8
  cvtsi2ss %edx,%xmm8
  movaps %xmm0,%xmm3
  mulss  (%rax),%xmm3
  movaps %xmm10,%xmm1
  mulss  0x4(%rax),%xmm1
  addss  %xmm1,%xmm3
  movaps %xmm9,%xmm1
  mulss  0x8(%rax),%xmm1
  addss  %xmm1,%xmm3
  movaps %xmm8,%xmm1
  mulss  0xc(%rax),%xmm1
  addss  %xmm1,%xmm3
  addss  0x10(%rax),%xmm3
  movaps %xmm0,%xmm2
  mulss  0x14(%rax),%xmm2
  movaps %xmm10,%xmm1
  mulss  0x18(%rax),%xmm1
  addss  %xmm1,%xmm2
  movaps %xmm9,%xmm1
  mulss  0x1c(%rax),%xmm1
  addss  %xmm1,%xmm2
  movaps %xmm8,%xmm1
  mulss  0x20(%rax),%xmm1
  addss  %xmm1,%xmm2
  addss  0x24(%rax),%xmm2
  movaps %xmm0,%xmm1
  mulss  0x28(%rax),%xmm1
  movaps %xmm10,%xmm11
  mulss  0x2c(%rax),%xmm11
  addss  %xmm11,%xmm1
  movaps %xmm9,%xmm11
  mulss  0x30(%rax),%xmm11
  addss  %xmm11,%xmm1
  movaps %xmm8,%xmm11
  mulss  0x34(%rax),%xmm11
  addss  %xmm11,%xmm1
  addss  0x38(%rax),%xmm1
  mulss  0x3c(%rax),%xmm0
  mulss  0x40(%rax),%xmm10
  addss  %xmm10,%xmm0
  mulss  0x44(%rax),%xmm9
  addss  %xmm9,%xmm0
  mulss  0x48(%rax),%xmm8
  addss  %xmm8,%xmm0
  addss  0x4c(%rax),%xmm0
  mov    %r11d,%edx
  comiss D28(%rip),%xmm3
  ja     L9
  mov    %esi,%edx
  comiss %xmm3,%xmm7
  ja     L9
  cvttss2si %xmm3,%edx
L9:
  mov    %r10d,%ebx
  comiss D28(%rip),%xmm2
  ja     L93
  mov    %esi,%ebx
  comiss %xmm2,%xmm6
  ja     L93
  cvttss2si %xmm2,%ebx
  shl    $0x8,%ebx
L93:
  or     %ebx,%edx
  mov    %r9d,%ebx
  comiss D28(%rip),%xmm1
  ja     L106
  mov    %esi,%ebx
  comiss %xmm1,%xmm5
  ja     L106
  cvttss2si %xmm1,%ebx
  shl    $0x10,%ebx
L106:
  or     %ebx,%edx
  mov    %r8d,%ebx
  comiss D28(%rip),%xmm0
  ja     L21
  mov    %esi,%ebx
  comiss %xmm0,%xmm4
  jbe    L108
  jmp    L21
L64:
  pop    %rbx
  ret
L35:
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D28
data_type: byte[4]

tool: {"D28": [0x00,0x00,0x7f,0x43]}

assistant: ```c
void colormatrix(unsigned char *img, int width, int height, float *m) {
  unsigned char *imgEnd = img + ((width * height) << 2);
  unsigned int *img32 = (unsigned int *)img;
  int r, g, b, a;
  float rr, rg, rb, ra;
  while (img < imgEnd) {
    r = *img;
    g = *(img + 1);
    b = *(img + 2);
    a = *(img + 3);
    rr = r * m[0] + g * m[1] + b * m[2] + a * m[3] + m[4];
    rg = r * m[5] + g * m[6] + b * m[7] + a * m[8] + m[9];
    rb = r * m[10] + g * m[11] + b * m[12] + a * m[13] + m[14];
    ra = r * m[15] + g * m[16] + b * m[17] + a * m[18] + m[19];
    *img32++ = (int)((rr) > 0xff ? 0xff : ((rr) < 0 ? 0 : (rr))) | (int)((rg) > 0xff ? 0xff : ((rg) < 0 ? 0 : (rg))) << 8 | (int)((rb) > 0xff ? 0xff : ((rb) < 0 ? 0 : (rb))) << 16 | (int)((ra) > 0xff ? 0xff : ((ra) < 0 ? 0 : (ra))) << 24;
    img += 4;
  }
}
```