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

```asm
<reduce_flow>:
  endbr64
  pxor   %xmm0,%xmm0
  push   %r15
  mov    %edx,%r9d
  mov    %ecx,%r15d
  cvtsi2ss %edx,%xmm0
  movss  D52(%rip),%xmm4
  push   %r14
  movss  D5(%rip),%xmm1
  movss  D48(%rip),%xmm6
  push   %r13
  push   %r12
  push   %rbp
  mulss  %xmm4,%xmm0
  push   %rbx
  mov    %rsi,-0x18(%rsp)
  movaps %xmm0,%xmm2
  andps  %xmm1,%xmm2
  ucomiss %xmm2,%xmm6
  jbe    L62
  cvttss2si %xmm0,%eax
  pxor   %xmm2,%xmm2
  movss  D31(%rip),%xmm7
  movaps %xmm1,%xmm3
  andnps %xmm0,%xmm3
  cvtsi2ss %eax,%xmm2
  movaps %xmm2,%xmm5
  cmpnless %xmm0,%xmm5
  andps  %xmm7,%xmm5
  subss  %xmm5,%xmm2
  orps   %xmm3,%xmm2
  movaps %xmm2,%xmm0
L62:
  cvttss2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %r15d,%xmm0
  mov    %eax,-0x10(%rsp)
  mulss  %xmm4,%xmm0
  movaps %xmm0,%xmm2
  andps  %xmm1,%xmm2
  ucomiss %xmm2,%xmm6
  jbe    L105
  cvttss2si %xmm0,%eax
  pxor   %xmm2,%xmm2
  movss  D31(%rip),%xmm5
  andnps %xmm0,%xmm1
  cvtsi2ss %eax,%xmm2
  movaps %xmm2,%xmm3
  cmpnless %xmm0,%xmm3
  andps  %xmm5,%xmm3
  subss  %xmm3,%xmm2
  orps   %xmm1,%xmm2
  movaps %xmm2,%xmm0
L105:
  cvttss2si %xmm0,%eax
  mov    %eax,-0xc(%rsp)
  lea    -0x1(%r15),%eax
  mov    %eax,-0x24(%rsp)
  cmp    $0x1,%eax
  jle    L133
  lea    -0x1(%r9),%r13d
  cmp    $0x1,%r13d
  jle    L133
  movslq -0x10(%rsp),%rax
  movss  D8(%rip),%xmm2
  mov    $0x1,%r14d
  pxor   %xmm6,%xmm6
  movss  D61(%rip),%xmm1
  movss  D20(%rip),%xmm5
  shl    $0x2,%rax
  mov    %rax,-0x20(%rsp)
  mov    -0x18(%rsp),%rax
  mov    %rax,-0x30(%rsp)
L124:
  lea    -0x1(%r14),%eax
  mov    -0x30(%rsp),%r12
  mov    $0x1,%r8d
  cltd
  idiv   %r15d
  mov    %r14d,%eax
  imul   %r9d,%edx
  mov    %edx,%ebp
  cltd
  idiv   %r15d
  lea    0x1(%r14),%eax
  mov    %edx,%ebx
  cltd
  idiv   %r15d
  imul   %r9d,%ebx
  imul   %r9d,%edx
  mov    %edx,%r11d
  nopl   0x0(%rax)
L117:
  lea    -0x1(%r8),%eax
  mov    %r8d,%r10d
  add    $0x4,%r12
  cltd
  idiv   %r9d
  lea    (%rdx,%rbp,1),%eax
  mov    %edx,%esi
  cltq
  movss  (%rdi,%rax,4),%xmm0
  mov    %r8d,%eax
  add    $0x2,%r8d
  cltd
  idiv   %r9d
  mulss  %xmm2,%xmm0
  addss  %xmm6,%xmm0
  lea    0x0(%rbp,%rdx,1),%eax
  mov    %edx,%ecx
  cltq
  movss  (%rdi,%rax,4),%xmm3
  lea    0x1(%r10),%eax
  cltd
  idiv   %r9d
  mulss  %xmm1,%xmm3
  addss  %xmm0,%xmm3
  lea    0x0(%rbp,%rdx,1),%eax
  cltq
  movss  (%rdi,%rax,4),%xmm0
  lea    (%rsi,%rbx,1),%eax
  add    %r11d,%esi
  cltq
  movslq %esi,%rsi
  mulss  %xmm2,%xmm0
  addss  %xmm3,%xmm0
  movss  (%rdi,%rax,4),%xmm3
  lea    (%rcx,%rbx,1),%eax
  add    %r11d,%ecx
  cltq
  movslq %ecx,%rcx
  mulss  %xmm1,%xmm3
  addss  %xmm0,%xmm3
  movss  (%rdi,%rax,4),%xmm0
  lea    (%rdx,%rbx,1),%eax
  add    %r11d,%edx
  cltq
  movslq %edx,%rdx
  mulss  %xmm5,%xmm0
  addss  %xmm3,%xmm0
  movss  (%rdi,%rax,4),%xmm3
  mulss  %xmm1,%xmm3
  addss  %xmm0,%xmm3
  movss  (%rdi,%rsi,4),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm3,%xmm0
  movss  (%rdi,%rcx,4),%xmm3
  mulss  %xmm1,%xmm3
  addss  %xmm0,%xmm3
  movss  (%rdi,%rdx,4),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm3,%xmm0
  mulss  %xmm4,%xmm0
  movss  %xmm0,-0x4(%r12)
  cmp    %r13d,%r8d
  jl     L117
  mov    -0x20(%rsp),%rbx
  add    $0x2,%r14d
  add    %rbx,-0x30(%rsp)
  cmp    %r14d,-0x24(%rsp)
  jg     L124
L133:
  and    $0x1,%r9d
  jne    L164
  mov    -0xc(%rsp),%esi
  test   %esi,%esi
  jle    L164
  movslq -0x10(%rsp),%rax
  mov    -0x18(%rsp),%rbx
  xor    %ecx,%ecx
  shl    $0x2,%rax
  lea    -0x8(%rbx,%rax,1),%rdx
L57:
  movss  (%rdx),%xmm0
  add    $0x1,%ecx
  movss  %xmm0,0x4(%rdx)
  add    %rax,%rdx
  cmp    %ecx,%esi
  jne    L57
L164:
  and    $0x1,%r15d
  jne    L162
  mov    -0x10(%rsp),%ebx
  test   %ebx,%ebx
  jle    L162
  mov    -0xc(%rsp),%eax
  lea    -0x1(%rbx),%edx
  sub    $0x2,%eax
  imul   %ebx,%eax
  lea    (%rax,%rbx,1),%ecx
  movslq %eax,%rdi
  movslq %ecx,%rsi
  lea    0x4(,%rdi,4),%r8
  shl    $0x2,%rsi
  mov    %rsi,%r9
  sub    %r8,%r9
  cmp    $0x8,%r9
  jbe    L119
  cmp    $0x2,%edx
  jbe    L119
  mov    -0x18(%rsp),%rdi
  shr    $0x2,%ebx
  xor    %edx,%edx
  lea    -0x4(%rdi,%r8,1),%r8
  add    %rdi,%rsi
  mov    %ebx,%edi
  shl    $0x4,%rdi
L166:
  movups (%r8,%rdx,1),%xmm7
  movups %xmm7,(%rsi,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%rdi
  jne    L166
  mov    -0x10(%rsp),%ebx
  mov    %ebx,%r15d
  and    $0xfffffffc,%r15d
  mov    %r15d,%edx
  mov    %ebx,%r15d
  test   $0x3,%bl
  je     L162
  mov    -0x18(%rsp),%rbx
  lea    (%rax,%rdx,1),%esi
  movslq %esi,%rsi
  movss  (%rbx,%rsi,4),%xmm0
  lea    (%rcx,%rdx,1),%esi
  movslq %esi,%rsi
  movss  %xmm0,(%rbx,%rsi,4)
  lea    0x1(%rdx),%esi
  cmp    %esi,%r15d
  jle    L162
  lea    (%rax,%rsi,1),%edi
  add    %ecx,%esi
  add    $0x2,%edx
  movslq %edi,%rdi
  movslq %esi,%rsi
  movss  (%rbx,%rdi,4),%xmm0
  movss  %xmm0,(%rbx,%rsi,4)
  cmp    %edx,%r15d
  jle    L162
  add    %edx,%eax
  cltq
  movss  (%rbx,%rax,4),%xmm0
  lea    (%rcx,%rdx,1),%eax
  cltq
  movss  %xmm0,(%rbx,%rax,4)
L162:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L119:
  mov    -0x18(%rsp),%rbx
  mov    %edx,%eax
  add    %rdi,%rax
  lea    0x4(%rbx,%rax,4),%rdx
  movslq -0x10(%rsp),%rax
  lea    (%rbx,%rdi,4),%rcx
L102:
  movss  (%rcx),%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x4,%rcx
  cmp    %rcx,%rdx
  jne    L102
  jmp    L162
```

tool_calls: name: disassemble_data
arguments: label: D52
datatype: byte[4]
name: disassemble_data
arguments: label: D5
datatype: byte[4]
name: disassemble_data
arguments: label: D48
datatype: byte[4]
name: disassemble_data
arguments: label: D31
datatype: byte[4]
name: disassemble_data
arguments: label: D8
datatype: f32
name: disassemble_data
arguments: label: D61
datatype: f32
name: disassemble_data
arguments: label: D20
datatype: f32

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

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

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

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

tool: D8: 0.0625

tool: D61: 0.125

tool: D20: 0.25

assistant: ```c
void reduce_flow(input, output, nx, ny) float *input, *output;
int nx, ny;
{
  float filter[3][3] = {{0.0625, 0.125, 0.0625}, {0.125, 0.25, 0.125}, {0.0625, 0.125, 0.0625}};
  float val;
  int i, ii, ir, j, jj, jr;
  int snx, sny, f_off, si, sj;
  int sample = 2, filter_size = 3;
  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 / 2.0;
      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];
    }
  }
}
```