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

```asm
<convertimage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movq   $0x0,-0x18(%rbp)
  jmp    L5
L15:
  mov    -0x18(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  shl    $0x2,%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    $0xffffff80,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x18(%rbp),%rax
  shl    $0x2,%rax
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  shl    $0x2,%rax
  lea    0x3(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    $0xffffff80,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  imul   $0x167,%eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  mov    %rax,%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  mov    -0x24(%rbp),%eax
  imul   $0xffffffa8,%eax,%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x1c(%rbp),%eax
  imul   $0xffffff49,%eax,%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  lea    0x1(%rax),%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  mov    -0x24(%rbp),%eax
  imul   $0x1c6,%eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  lea    0x2(%rax),%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  mov    -0x1c(%rbp),%eax
  imul   $0x167,%eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  lea    0x3(%rax),%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  mov    -0x24(%rbp),%eax
  imul   $0xffffffa8,%eax,%edx
  mov    -0x20(%rbp),%eax
  add    %eax,%edx
  mov    -0x1c(%rbp),%eax
  imul   $0xffffff49,%eax,%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  lea    0x4(%rax),%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  mov    -0x24(%rbp),%eax
  imul   $0x1c6,%eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  add    %rax,%rax
  lea    0x5(%rax),%rcx
  mov    -0x40(%rbp),%rax
  lea    (%rcx,%rax,1),%rbx
  mov    %edx,%edi
  call   <clamp@plt>
  mov    %al,(%rbx)
  addq   $0x1,-0x18(%rbp)
L5:
  mov    -0x48(%rbp),%rax
  shr    $0x2,%rax
  cmp    %rax,-0x18(%rbp)
  jb     L15
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void convertimage(unsigned char *inbuf, unsigned char *outbuf, size_t insize) {
  size_t i;
  for (i = 0; i < insize / 4; i++) {
    int y1 = inbuf[i * 4 + 0] << 8;
    int u = inbuf[i * 4 + 1] - 128;
    int y2 = inbuf[i * 4 + 2] << 8;
    int v = inbuf[i * 4 + 3] - 128;
    outbuf[i * 6 + 0] = clamp((y1 + (359 * v)) >> 8);
    outbuf[i * 6 + 1] = clamp((y1 - (88 * u) - (183 * v)) >> 8);
    outbuf[i * 6 + 2] = clamp((y1 + (454 * u)) >> 8);
    outbuf[i * 6 + 3] = clamp((y2 + (359 * v)) >> 8);
    outbuf[i * 6 + 4] = clamp((y2 - (88 * u) - (183 * v)) >> 8);
    outbuf[i * 6 + 5] = clamp((y2 + (454 * u)) >> 8);
  }
}
```