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

```asm
<dsmooth>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  movss  %xmm0,-0x84(%rbp)
  mov    %rcx,-0x90(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0x84(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <ceilf@plt>
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x50(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  cvtss2sd -0x84(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd -0x84(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D42(%rip),%xmm0
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x4c(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L36
L77:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x68(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x54(%rbp),%xmm1
  cvtss2sd %xmm1,%xmm1
  movsd  D44(%rip),%xmm3
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D24(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x3c(%rbp)
  movss  -0x3c(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  mulss  -0x4c(%rbp),%xmm0
  movd   %xmm0,%eax
  mov    -0x68(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movd   %eax,%xmm0
  call   <exp@plt>
  movd   %xmm0,%eax
  mov    %eax,(%rbx)
  addl   $0x1,-0x68(%rbp)
L36:
  mov    -0x68(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L77
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x5c(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L167
L121:
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x5c(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x5c(%rbp)
  addl   $0x1,-0x68(%rbp)
L167:
  mov    -0x68(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L121
  movss  D2(%rip),%xmm0
  divss  -0x5c(%rbp),%xmm0
  movss  %xmm0,-0x48(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L117
L128:
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mulss  -0x48(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x68(%rbp)
L117:
  mov    -0x68(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L128
  mov    -0x80(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <MAX@plt>
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L173
L62:
  mov    -0x64(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L196
L189:
  mov    -0x68(%rbp),%eax
  sub    -0x50(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <MAX@plt>
  mov    %eax,-0x44(%rbp)
  mov    -0x68(%rbp),%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x7c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x40(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <MIN@plt>
  mov    %eax,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  jmp    L174
L68:
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  sub    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x58(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x58(%rbp)
  addl   $0x1,-0x60(%rbp)
L174:
  mov    -0x60(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L68
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  -0x58(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x68(%rbp)
L196:
  mov    -0x68(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L189
  mov    -0x7c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x90(%rbp),%rax
  add    %rax,%rcx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x64(%rbp)
L173:
  mov    -0x64(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L62
  movl   $0x0,-0x68(%rbp)
  jmp    L218
L47:
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L151
L74:
  mov    -0x64(%rbp),%eax
  sub    -0x50(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <MAX@plt>
  mov    %eax,-0x44(%rbp)
  mov    -0x64(%rbp),%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x80(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x40(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <MIN@plt>
  mov    %eax,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  jmp    L78
L82:
  mov    -0x60(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x60(%rbp),%eax
  sub    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x58(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x58(%rbp)
  addl   $0x1,-0x60(%rbp)
L78:
  mov    -0x60(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L82
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  -0x58(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x64(%rbp)
L151:
  mov    -0x64(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L74
  movl   $0x0,-0x64(%rbp)
  jmp    L83
L30:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x64(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x68(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x90(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x64(%rbp)
L83:
  mov    -0x64(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L30
  addl   $0x1,-0x68(%rbp)
L218:
  mov    -0x68(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L47
  cmpq   $0x0,-0x30(%rbp)
  je     L5
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L5:
  movq   $0x0,-0x30(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L202
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L202:
  movq   $0x0,-0x38(%rbp)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D9
type_guessed: f64
name: retrieve_data
arguments: tag: D42
type_guessed: f32[2]
name: retrieve_data
arguments: tag: D44
type_guessed: f64
name: retrieve_data
arguments: tag: D24
type_guessed: f64
name: retrieve_data
arguments: tag: D2
type_guessed: byte[4]

tool: D9: 3

tool: {"D42": [0.0,-1.875]}

tool: D44: 1

tool: D24: 0.5

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

assistant: ```c
void dsmooth(float *image, int nx, int ny, float sigma, float *smooth) {
  int i, j, npix, half, start, end, sample;
  float neghalfinvvar, total, scale, dx, sum;
  float *kernel1D;
  float *kernel_shifted;
  float *smooth_temp;
  npix = 2 * ((int)ceilf(3. * sigma)) + 1;
  half = npix / 2;
  kernel1D = malloc(npix * sizeof(float));
  neghalfinvvar = -1.0 / (2.0 * sigma * sigma);
  for (i = 0; i < npix; i++) {
    dx = ((float)i - 0.5 * ((float)npix - 1.));
    kernel1D[i] = exp((dx * dx) * neghalfinvvar);
  }
  total = 0.0;
  for (i = 0; i < npix; i++)
    total += kernel1D[i];
  scale = 1. / total;
  for (i = 0; i < npix; i++)
    kernel1D[i] *= scale;
  smooth_temp = malloc(sizeof(float) * MAX(nx, ny));
  kernel_shifted = kernel1D + half;
  for (j = 0; j < ny; j++) {
    float *imagerow = image + j * nx;
    for (i = 0; i < nx; i++) {
      start = i - half;
      start = MAX(start, 0);
      end = i + half;
      end = MIN(end, nx - 1);
      sum = 0.0;
      for (sample = start; sample <= end; sample++)
        sum += imagerow[sample] * kernel_shifted[sample - i];
      smooth_temp[i] = sum;
    }
    memcpy(smooth + j * nx, smooth_temp, nx * sizeof(float));
  }
  for (i = 0; i < nx; i++) {
    float *imagecol = smooth + i;
    for (j = 0; j < ny; j++) {
      start = j - half;
      start = MAX(start, 0);
      end = j + half;
      end = MIN(end, ny - 1);
      sum = 0.0;
      for (sample = start; sample <= end; sample++)
        sum += imagecol[sample * nx] * kernel_shifted[sample - j];
      smooth_temp[j] = sum;
    }
    for (j = 0; j < ny; j++)
      smooth[i + j * nx] = smooth_temp[j];
  }
  {
    if ((smooth_temp) != NULL)
      free((char *)(smooth_temp));
    (smooth_temp) = NULL;
  };
  {
    if ((kernel1D) != NULL)
      free((char *)(kernel1D));
    (kernel1D) = NULL;
  };
}
```