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

```asm
<spatial_disconts>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L55
L86:
  movl   $0x1,-0x14(%rbp)
  jmp    L8
L36:
  mov    -0x18(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L83
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  D6(%rip),%xmm1
  xorps  %xmm1,%xmm0
  jmp    L109
L83:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
L109:
  comiss -0x4(%rbp),%xmm0
  jae    L37
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L42
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  D6(%rip),%xmm1
  xorps  %xmm1,%xmm0
  jmp    L20
L42:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
L20:
  comiss -0x4(%rbp),%xmm0
  jae    L37
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L45
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  D6(%rip),%xmm1
  xorps  %xmm1,%xmm0
  jmp    L126
L45:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
L126:
  comiss -0x4(%rbp),%xmm0
  jae    L37
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L72
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  D6(%rip),%xmm1
  xorps  %xmm1,%xmm0
  jmp    L166
L72:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
L166:
  comiss -0x4(%rbp),%xmm0
  jb     L145
L37:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L162
L145:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movss  D25(%rip),%xmm0
  movss  %xmm0,(%rax)
L162:
  addl   $0x1,-0x14(%rbp)
L8:
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L36
  addl   $0x1,-0x18(%rbp)
L55:
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x18(%rbp)
  jl     L86
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L106
L198:
  mov    -0x18(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x18(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L106:
  mov    -0x18(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L198
  movl   $0x0,-0x14(%rbp)
  jmp    L47
L89:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L47:
  mov    -0x14(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L89
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D16
data_type: f64
name: extract_symbolic_data
arguments: tag: D6
data_type: byte[4]
name: extract_symbolic_data
arguments: tag: D25
data_type: f32

tool: D16: 1.4142136

tool: {"D6": [0x00,0x00,0x00,0x80]}

tool: D25: 1

assistant: ```c
void spatial_disconts(u, v, s2, nx, ny, discont) float *u, *v, *discont;
int nx, ny;
float *s2;
{
  float image_abs_max(), variance(), mean();
  int index, nx_max, ny_max, i, j;
  float t2;
  for (i = 1; i < ny - 1; i++) {
    for (j = 1; j < nx - 1; j++) {
      index = i * nx + j;
      t2 = s2[index] * 1.4142136;
      if ((((u[index] - u[index - nx]) < 0 ? -(u[index] - u[index - nx]) : (u[index] - u[index - nx])) >= t2) || (((u[index] - u[index - 1]) < 0 ? -(u[index] - u[index - 1]) : (u[index] - u[index - 1])) >= t2) || (((v[index] - v[index - nx]) < 0 ? -(v[index] - v[index - nx]) : (v[index] - v[index - nx])) >= t2) || (((v[index] - v[index - 1]) < 0 ? -(v[index] - v[index - 1]) : (v[index] - v[index - 1])) >= t2))
        discont[index] = 0.0;
      else
        discont[index] = 1.0;
    }
  }
  ny_max = ny - 1;
  nx_max = nx - 1;
  for (i = 0; i < ny; i++) {
    discont[i * nx] = 0.0;
    discont[i * nx + nx_max] = 0.0;
  }
  for (j = 0; j < nx; j++) {
    discont[j] = 0.0;
    discont[ny_max * nx + j] = 0.0;
  }
}
```