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

```asm
<KDE>:
  endbr64
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x40000,%edi
  sub    $0x108,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  call   <MemAlloc@plt>
  mov    %rax,%r12
L30:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13d,%xmm0
  subsd  D29(%rip),%xmm0
  mulsd  %xmm0,%xmm0
  xorpd  D20(%rip),%xmm0
  divsd  D26(%rip),%xmm0
  call   <exp@plt>
  movsd  %xmm0,0x0(%rbp,%r13,8)
  add    $0x1,%r13
  cmp    $0x1f,%r13
  jne    L30
  movsd  (%rsp),%xmm0
  pxor   %xmm3,%xmm3
  mov    %r12,%rdi
  xor    %r9d,%r9d
  movsd  0x8(%rsp),%xmm1
  movapd (%rsp),%xmm2
  lea    0xf8(%rsp),%r8
  movsd  0xf0(%rsp),%xmm4
  addsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x10(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x18(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x20(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0x28(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x30(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x38(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x40(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0x48(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x50(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x58(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x60(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0x68(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x70(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x78(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x80(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0x88(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x90(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x98(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0xa0(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0xa8(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0xb0(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0xb8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0xc0(%rsp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  0xc8(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0xd0(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0xd8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0xe0(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0xe8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  addsd  %xmm4,%xmm1
  divsd  %xmm1,%xmm4
  movapd %xmm1,%xmm0
  unpcklpd %xmm0,%xmm0
  divpd  %xmm0,%xmm2
  movaps %xmm2,(%rsp)
  movapd 0x10(%rsp),%xmm2
  movsd  %xmm4,0xf0(%rsp)
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x10(%rsp)
  movapd 0x20(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x20(%rsp)
  movapd 0x30(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x30(%rsp)
  movapd 0x40(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x40(%rsp)
  movapd 0x50(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x50(%rsp)
  movapd 0x60(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x60(%rsp)
  movapd 0x70(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x70(%rsp)
  movapd 0x80(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x80(%rsp)
  movapd 0x90(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0x90(%rsp)
  movapd 0xa0(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0xa0(%rsp)
  movapd 0xb0(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0xb0(%rsp)
  movapd 0xc0(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0xc0(%rsp)
  movapd 0xd0(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0xd0(%rsp)
  movapd 0xe0(%rsp),%xmm2
  divpd  %xmm0,%xmm2
  movaps %xmm2,0xe0(%rsp)
L22:
  movq   $0x0,(%rdi)
  lea    -0xf(%r9),%ecx
  mov    %rbp,%rdx
  movapd %xmm3,%xmm1
  nopl   0x0(%rax)
L36:
  mov    $0x7fff,%eax
  cmp    %eax,%ecx
  cmovle %ecx,%eax
  xor    %esi,%esi
  test   %eax,%eax
  cmovs  %esi,%eax
  add    $0x8,%rdx
  add    $0x1,%ecx
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rdi)
  cmp    %r8,%rdx
  jne    L36
  add    $0x1,%r9d
  add    $0x8,%rdi
  cmp    $0x8000,%r9d
  jne    L22
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x108,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D29
type_guessed: f64
name: parse_data
arguments: data_tag: D20
type_guessed: f32[4]
name: parse_data
arguments: data_tag: D26
type_guessed: f32[2]

tool: D29: 15.5

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

tool: {"D26": [0.0,3.3828125]}

assistant: ```c
double *KDE(double *h16) {
  double *tmp;
  int i, j, k;
  double kernel[31];
  double b, c;
  tmp = (double *)MemAlloc(32768 * sizeof(double));
  c = 2 * (7.0 * 7.0);
  for (i = 0; i < 31; i++) {
    b = i - 15.5;
    b *= b;
    kernel[i] = exp(-b / c);
  }
  c = 0.0;
  for (i = 0; i < 31; i++)
    c += kernel[i];
  for (i = 0; i < 31; i++)
    kernel[i] /= c;
  for (i = 0; i < 32768; i++) {
    tmp[i] = 0.0;
    for (j = 0; j < 31; j++) {
      k = i + j - 15;
      if (k < 0)
        k = 0;
      if (k > 32767)
        k = 32767;
      tmp[i] += kernel[j] * h16[k];
    }
  }
  return tmp;
}
```