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

```asm
<convolve3>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %edx,%r12d
  mov    %rcx,-0x28(%rsp)
  mov    %r8d,%r11d
  mov    %r9,-0x18(%rsp)
  lea    -0x1(%r8),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D25(%rip),%xmm0
  movapd %xmm0,%xmm3
  movsd  D54(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D99(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L26
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movapd %xmm1,%xmm3
  cmpnlesd %xmm0,%xmm3
  movsd  D57(%rip),%xmm4
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm1
  andnpd %xmm0,%xmm2
  movapd %xmm1,%xmm3
  orpd   %xmm2,%xmm3
L26:
  cvttsd2si %xmm3,%eax
  mov    %eax,-0xc(%rsp)
  pxor   %xmm4,%xmm4
  cvtsi2ssl 0x38(%rsp),%xmm4
  pxor   %xmm0,%xmm0
  cvtsi2ss %esi,%xmm0
  divss  %xmm4,%xmm0
  movaps %xmm0,%xmm3
  movss  D73(%rip),%xmm2
  movaps %xmm0,%xmm1
  andps  %xmm2,%xmm1
  movss  D18(%rip),%xmm5
  ucomiss %xmm1,%xmm5
  jbe    L60
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm3
  cmpnless %xmm0,%xmm3
  movss  D67(%rip),%xmm5
  andps  %xmm5,%xmm3
  subss  %xmm3,%xmm1
  andnps %xmm0,%xmm2
  movaps %xmm1,%xmm3
  orps   %xmm2,%xmm3
L60:
  cvttss2si %xmm3,%eax
  mov    %eax,-0x10(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2ss %r12d,%xmm0
  divss  %xmm4,%xmm0
  movaps %xmm0,%xmm3
  movss  D73(%rip),%xmm2
  movaps %xmm0,%xmm1
  andps  %xmm2,%xmm1
  movss  D18(%rip),%xmm4
  ucomiss %xmm1,%xmm4
  jbe    L139
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm3
  cmpnless %xmm0,%xmm3
  movss  D67(%rip),%xmm4
  andps  %xmm4,%xmm3
  subss  %xmm3,%xmm1
  andnps %xmm0,%xmm2
  movaps %xmm1,%xmm3
  orps   %xmm2,%xmm3
L139:
  cvttss2si %xmm3,%eax
  mov    %eax,-0x8(%rsp)
  cmp    $0x2,%r12d
  jle    L134
  lea    0x1(%r11),%r13d
  mov    -0xc(%rsp),%ebx
  sub    %ebx,%r13d
  lea    -0x3(%r12),%eax
  and    $0xfffffffe,%eax
  lea    0x3(%r11,%rax,1),%eax
  sub    %ebx,%eax
  mov    %eax,-0x4(%rsp)
  movl   $0x0,-0x1c(%rsp)
  lea    -0x3(%rsi),%r15d
  and    $0xfffffffe,%r15d
  add    $0x3,%r15d
  sub    %ebx,%r15d
  jmp    L126
L52:
  add    $0x1,%r8d
  add    $0xc,%rbx
  cmp    %r13d,%r8d
  je     L18
L79:
  mov    %rbx,%r9
  mov    %r8d,%eax
  cltd
  idiv   %r12d
  mov    %edx,%edi
  imul   %esi,%edi
  mov    $0x0,%ecx
L0:
  lea    (%r10,%rcx,1),%eax
  cltd
  idiv   %esi
  add    %edi,%edx
  movslq %edx,%rdx
  movss  0x0(%rbp,%rdx,4),%xmm0
  mulss  (%r9,%rcx,4),%xmm0
  addss  %xmm0,%xmm1
  add    $0x1,%rcx
  cmp    %ecx,%r11d
  jg     L0
  jmp    L52
L18:
  movss  %xmm1,(%r14)
  add    $0x4,%r14
  add    $0x2,%r10d
  cmp    %r15d,%r10d
  je     L194
L66:
  pxor   %xmm1,%xmm1
  test   %r11d,%r11d
  jle    L18
  mov    %r13d,%r8d
  sub    %r11d,%r8d
  mov    -0x28(%rsp),%rbx
  pxor   %xmm1,%xmm1
  jmp    L79
L194:
  mov    -0x10(%rsp),%ebx
  add    %ebx,-0x1c(%rsp)
  add    $0x2,%r13d
  cmp    -0x4(%rsp),%r13d
  je     L134
L126:
  cmp    $0x2,%esi
  jle    L194
  movslq -0x1c(%rsp),%rax
  mov    -0x18(%rsp),%rbx
  lea    (%rbx,%rax,4),%r14
  mov    $0x1,%r10d
  sub    -0xc(%rsp),%r10d
  jmp    L66
L134:
  test   $0x1,%sil
  jne    L156
  cmpl   $0x0,-0x8(%rsp)
  jle    L156
  movslq -0x10(%rsp),%rdx
  shl    $0x2,%rdx
  mov    -0x18(%rsp),%rax
  add    %rdx,%rax
  mov    $0x0,%ecx
L1:
  movss  -0x8(%rax),%xmm0
  movss  %xmm0,-0x4(%rax)
  add    $0x1,%ecx
  add    %rdx,%rax
  cmp    %ecx,-0x8(%rsp)
  jne    L1
L156:
  test   $0x1,%r12b
  jne    L144
  mov    -0x10(%rsp),%ebx
  test   %ebx,%ebx
  jle    L144
  mov    -0x8(%rsp),%eax
  sub    $0x2,%eax
  imul   %ebx,%eax
  cltq
  mov    -0x18(%rsp),%rsi
  lea    (%rsi,%rax,4),%rdx
  lea    -0x1(%rbx),%ecx
  add    %rcx,%rax
  lea    0x4(%rsi,%rax,4),%rcx
  movslq %ebx,%rax
L160:
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L160
L144:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: tag: D25
datatype: f32[2]
name: parse_data
arguments: tag: D54
datatype: byte[8]
name: parse_data
arguments: tag: D99
datatype: f32[2]
name: parse_data
arguments: tag: D57
datatype: f32[2]
name: parse_data
arguments: tag: D73
datatype: byte[4]
name: parse_data
arguments: tag: D18
datatype: byte[4]
name: parse_data
arguments: tag: D67
datatype: byte[4]

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

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

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

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

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

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

tool: {"D67": [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];
    }
  }
}
```