user: Converte this assembly snippet into its equivalent C code:

```asm
<convolve3>:
  endbr64
  lea    -0x1(%r8),%eax
  pxor   %xmm0,%xmm0
  push   %r15
  mov    %rdi,%r11
  cvtsi2sd %eax,%xmm0
  push   %r14
  mov    %edx,%r15d
  mov    %r8d,%r10d
  mulsd  D20(%rip),%xmm0
  movsd  D1(%rip),%xmm2
  push   %r13
  movsd  D79(%rip),%xmm3
  push   %r12
  push   %rbp
  push   %rbx
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  mov    %rcx,-0x30(%rsp)
  ucomisd %xmm1,%xmm3
  mov    %r9,-0x28(%rsp)
  jbe    L93
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  movsd  D37(%rip),%xmm4
  andnpd %xmm0,%xmm2
  cvtsi2sd %rax,%xmm1
  movapd %xmm1,%xmm3
  cmpnlesd %xmm0,%xmm3
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm1
  movapd %xmm1,%xmm0
  orpd   %xmm2,%xmm0
L93:
  cvttsd2si %xmm0,%eax
  pxor   %xmm6,%xmm6
  pxor   %xmm0,%xmm0
  movss  D51(%rip),%xmm5
  cvtsi2ssl 0x38(%rsp),%xmm6
  movss  D55(%rip),%xmm1
  cvtsi2ss %esi,%xmm0
  movaps %xmm1,%xmm3
  mov    %eax,-0x18(%rsp)
  divss  %xmm6,%xmm0
  movaps %xmm0,%xmm2
  andps  %xmm1,%xmm2
  ucomiss %xmm2,%xmm5
  jbe    L200
  cvttss2si %xmm0,%eax
  pxor   %xmm2,%xmm2
  movss  D45(%rip),%xmm7
  andnps %xmm0,%xmm3
  cvtsi2ss %eax,%xmm2
  movaps %xmm2,%xmm4
  cmpnless %xmm0,%xmm4
  andps  %xmm7,%xmm4
  subss  %xmm4,%xmm2
  orps   %xmm3,%xmm2
  movaps %xmm2,%xmm0
L200:
  cvttss2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %r15d,%xmm0
  mov    %eax,-0x20(%rsp)
  divss  %xmm6,%xmm0
  movaps %xmm0,%xmm2
  andps  %xmm1,%xmm2
  ucomiss %xmm2,%xmm5
  jbe    L96
  cvttss2si %xmm0,%eax
  pxor   %xmm2,%xmm2
  movss  D45(%rip),%xmm4
  andnps %xmm0,%xmm1
  cvtsi2ss %eax,%xmm2
  movaps %xmm2,%xmm3
  cmpnless %xmm0,%xmm3
  andps  %xmm4,%xmm3
  subss  %xmm3,%xmm2
  orps   %xmm1,%xmm2
  movaps %xmm2,%xmm0
L96:
  cvttss2si %xmm0,%eax
  mov    %eax,-0x14(%rsp)
  cmp    $0x2,%r15d
  jle    L228
  cmp    $0x2,%esi
  jle    L228
  mov    -0x18(%rsp),%ebx
  lea    0x1(%r10),%eax
  movl   $0x0,-0x1c(%rsp)
  pxor   %xmm2,%xmm2
  sub    %ebx,%eax
  mov    %eax,%r14d
  mov    $0x1,%eax
  sub    %ebx,%eax
  mov    %eax,%edi
  mov    %eax,-0x10(%rsp)
  lea    -0x3(%r15),%eax
  and    $0xfffffffe,%eax
  mov    %edi,-0x38(%rsp)
  add    $0x3,%eax
  sub    %ebx,%eax
  mov    %eax,-0xc(%rsp)
  lea    -0x3(%rsi),%eax
  and    $0xfffffffe,%eax
  add    $0x3,%eax
  sub    %ebx,%eax
  mov    %eax,-0x34(%rsp)
L239:
  mov    -0x28(%rsp),%rbx
  movslq -0x1c(%rsp),%rax
  mov    $0x3,%ebp
  mov    -0x10(%rsp),%r13d
  lea    (%rbx,%rax,4),%rax
  mov    $0x2,%ebx
  mov    %rax,-0x40(%rsp)
  mov    -0x18(%rsp),%eax
  sub    %eax,%ebx
  sub    %eax,%ebp
  nopl   0x0(%rax,%rax,1)
L159:
  movaps %xmm2,%xmm0
  test   %r10d,%r10d
  jle    L35
  mov    %r13d,%eax
  mov    -0x30(%rsp),%rdi
  mov    -0x38(%rsp),%r8d
  movaps %xmm2,%xmm0
  cltd
  idiv   %esi
  lea    0x3(%r13),%eax
  mov    %eax,-0x44(%rsp)
  mov    %edx,%r12d
  nopw   0x0(%rax,%rax,1)
L168:
  mov    %r8d,%eax
  cltd
  idiv   %r15d
  mov    %edx,%ecx
  imul   %esi,%ecx
  lea    (%rcx,%r12,1),%eax
  cltq
  movss  (%r11,%rax,4),%xmm1
  mulss  (%rdi),%xmm1
  addss  %xmm1,%xmm0
  cmp    $0x1,%r10d
  je     L198
  mov    %ebx,%eax
  cltd
  idiv   %esi
  add    %ecx,%edx
  movslq %edx,%rdx
  movss  (%r11,%rdx,4),%xmm1
  mulss  0x4(%rdi),%xmm1
  addss  %xmm1,%xmm0
  cmp    $0x2,%r10d
  je     L198
  mov    %ebp,%eax
  cltd
  idiv   %esi
  add    %ecx,%edx
  movslq %edx,%rdx
  movss  (%r11,%rdx,4),%xmm1
  mulss  0x8(%rdi),%xmm1
  addss  %xmm1,%xmm0
  cmp    $0x3,%r10d
  je     L198
  mov    -0x44(%rsp),%eax
  cltd
  idiv   %esi
  add    %ecx,%edx
  movslq %edx,%rdx
  movss  (%r11,%rdx,4),%xmm1
  mulss  0xc(%rdi),%xmm1
  addss  %xmm1,%xmm0
  cmp    $0x4,%r10d
  je     L198
  mov    $0x4,%r9d
L141:
  lea    0x0(%r13,%r9,1),%eax
  cltd
  idiv   %esi
  add    %ecx,%edx
  movslq %edx,%rdx
  movss  (%r11,%rdx,4),%xmm1
  mulss  (%rdi,%r9,4),%xmm1
  add    $0x1,%r9
  addss  %xmm1,%xmm0
  cmp    %r9d,%r10d
  jg     L141
  nopl   (%rax)
L198:
  add    $0x1,%r8d
  add    $0xc,%rdi
  cmp    %r14d,%r8d
  jne    L168
L35:
  mov    -0x40(%rsp),%rax
  add    $0x2,%r13d
  add    $0x2,%ebx
  add    $0x2,%ebp
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  mov    %rax,-0x40(%rsp)
  cmp    -0x34(%rsp),%r13d
  jne    L159
  addl   $0x2,-0x38(%rsp)
  mov    -0x20(%rsp),%ebx
  add    $0x2,%r14d
  add    %ebx,-0x1c(%rsp)
  mov    -0x38(%rsp),%eax
  cmp    -0xc(%rsp),%eax
  jne    L239
L228:
  and    $0x1,%esi
  jne    L249
  mov    -0x14(%rsp),%eax
  test   %eax,%eax
  jle    L249
  movslq -0x20(%rsp),%rax
  mov    -0x28(%rsp),%rbx
  xor    %ecx,%ecx
  shl    $0x2,%rax
  lea    -0x8(%rbx,%rax,1),%rdx
L196:
  movss  (%rdx),%xmm0
  add    $0x1,%ecx
  movss  %xmm0,0x4(%rdx)
  add    %rax,%rdx
  cmp    %ecx,-0x14(%rsp)
  jne    L196
L249:
  and    $0x1,%r15d
  jne    L115
  mov    -0x20(%rsp),%ebx
  test   %ebx,%ebx
  jle    L115
  mov    -0x14(%rsp),%eax
  lea    -0x1(%rbx),%ecx
  sub    $0x2,%eax
  imul   %ebx,%eax
  lea    (%rax,%rbx,1),%edx
  movslq %eax,%rdi
  movslq %edx,%rsi
  lea    0x4(,%rdi,4),%r8
  shl    $0x2,%rsi
  mov    %rsi,%r9
  sub    %r8,%r9
  cmp    $0x8,%r9
  jbe    L29
  cmp    $0x2,%ecx
  jbe    L29
  mov    -0x28(%rsp),%rdi
  shr    $0x2,%ebx
  xor    %ecx,%ecx
  lea    -0x4(%rdi,%r8,1),%r8
  add    %rdi,%rsi
  mov    %ebx,%edi
  shl    $0x4,%rdi
L20:
  movups (%r8,%rcx,1),%xmm7
  movups %xmm7,(%rsi,%rcx,1)
  add    $0x10,%rcx
  cmp    %rdi,%rcx
  jne    L20
  mov    -0x20(%rsp),%ebx
  mov    %ebx,%r9d
  and    $0xfffffffc,%r9d
  mov    %r9d,%ecx
  mov    %ebx,%r9d
  test   $0x3,%bl
  je     L115
  mov    -0x28(%rsp),%rbx
  lea    (%rax,%rcx,1),%esi
  movslq %esi,%rsi
  movss  (%rbx,%rsi,4),%xmm0
  lea    (%rdx,%rcx,1),%esi
  movslq %esi,%rsi
  movss  %xmm0,(%rbx,%rsi,4)
  lea    0x1(%rcx),%esi
  cmp    %esi,%r9d
  jle    L115
  lea    (%rax,%rsi,1),%edi
  add    %edx,%esi
  add    $0x2,%ecx
  movslq %edi,%rdi
  movslq %esi,%rsi
  movss  (%rbx,%rdi,4),%xmm0
  movss  %xmm0,(%rbx,%rsi,4)
  cmp    %ecx,%r9d
  jle    L115
  add    %ecx,%eax
  cltq
  movss  (%rbx,%rax,4),%xmm0
  lea    (%rdx,%rcx,1),%eax
  cltq
  movss  %xmm0,(%rbx,%rax,4)
L115:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  mov    -0x28(%rsp),%rbx
  mov    %ecx,%eax
  add    %rdi,%rax
  lea    0x4(%rbx,%rax,4),%rcx
  movslq -0x20(%rsp),%rax
  lea    (%rbx,%rdi,4),%rdx
L59:
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L59
  jmp    L115
```

tool_calls: name: retrieve_data
arguments: tag: D20
data_type: f32[2]
name: retrieve_data
arguments: tag: D1
data_type: byte[8]
name: retrieve_data
arguments: tag: D79
data_type: f32[2]
name: retrieve_data
arguments: tag: D37
data_type: f32[2]
name: retrieve_data
arguments: tag: D51
data_type: byte[4]
name: retrieve_data
arguments: tag: D55
data_type: byte[4]
name: retrieve_data
arguments: tag: D45
data_type: byte[4]

tool: {"D20": [0.0,1.75]}

tool: {"D1": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D79": [0.0,176.0]}

tool: {"D37": [0.0,1.875]}

tool: {"D51": [0x00,0x00,0x00,0x4b]}

tool: {"D55": [0xff,0xff,0xff,0x7f]}

tool: {"D45": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void convolve3(input, nx, ny, filter, filter_size, output, sample) float *input, filter[3][3];
float *output;
int nx, ny, filter_size, sample;
{
  float val;
  int i, ii, ir, j, jj, jr;
  int snx, sny, f_off, si, sj;
  f_off = (int)floor((filter_size - 1) / 2.0);
  snx = (int)floor(nx / ((float)sample));
  sny = (int)floor(ny / ((float)sample));
  si = 0;
  for (i = 1; i < ny - 1; i = i + 2) {
    sj = 0;
    for (j = 1; j < nx - 1; j = j + 2) {
      val = 0.0;
      for (ii = 0; ii < filter_size; ii++) {
        ir = (i + ii - f_off) % ny;
        for (jj = 0; jj < filter_size; jj++) {
          jr = (j + jj - f_off) % nx;
          val += filter[ii][jj] * input[(int)(ir * nx + jr)];
        }
      }
      output[si * snx + sj] = val;
      sj++;
    }
    si++;
  }
  if ((nx % 2) == 0) {
    for (i = 0; i < sny; i++) {
      output[(i * snx) + (snx - 1)] = output[i * snx + (snx - 2)];
    }
  }
  if ((ny % 2) == 0) {
    for (j = 0; j < snx; j++) {
      output[((sny - 1) * snx) + j] = output[(sny - 2) * snx + j];
    }
  }
}
```