user: What is the c source code of the assembly code below:

```asm
<shrink_to_sigma_factor>:
  endbr64
  movapd %xmm1,%xmm2
  push   %r15
  mulsd  %xmm0,%xmm2
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  movsd  %xmm0,(%rsp)
  movapd %xmm2,%xmm0
  mov    %ecx,0x18(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <ceil@plt>
  mov    0x18(%rsp),%ecx
  lea    -0x1(%rax,%rax,1),%esi
  mov    %rax,0x10(%rsp)
  mov    %esi,(%r12)
  cmp    %ecx,%esi
  ja     L56
  test   $0x1,%cl
  je     L56
L98:
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm3
  mov    %esi,%r13d
  lea    D9(%rip),%rdi
  imul   %esi,%r13d
  mov    %ecx,0x18(%rsp)
  mulsd  %xmm1,%xmm1
  imul   %esi,%r13d
  mulsd  %xmm3,%xmm1
  mov    %r13,%rdx
  mulsd  %xmm3,%xmm1
  movsd  %xmm1,(%rsp)
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <do_vect@plt>
  mov    0x18(%rsp),%ecx
  mov    (%r12),%r9d
  movsd  (%rsp),%xmm1
  mov    %ecx,%r12d
  mov    %ecx,%r11d
  sub    %r9d,%r12d
  mov    %r12d,%edi
  shr    %edi
  sub    %edi,%r11d
  mov    %edi,0x8(%rsp)
  cmp    %edi,%r11d
  jle    L77
  mov    %r9d,%esi
  mov    %ecx,%eax
  lea    0x1(%rcx),%r13d
  mov    %r11d,%r14d
  imul   %r9d,%esi
  mov    %rbp,0x18(%rsp)
  sub    %edi,%r14d
  imul   %ecx,%eax
  imul   %ecx,%r13d
  sub    %esi,%eax
  mov    %eax,(%rsp)
  mov    %edi,%eax
  add    $0x1,%r13d
  mov    %eax,%r10d
  imul   %edi,%r13d
  mov    %eax,%r15d
  mov    0x0(%rbp),%rdi
  sub    %ecx,%r10d
  mov    %esi,%ebp
  add    %eax,%r10d
  nopl   (%rax)
L124:
  mov    0x8(%rsp),%r8d
  mov    %r14d,%ecx
  mov    %r13d,%esi
  nopl   0x0(%rax,%rax,1)
L115:
  lea    (%r10,%rcx,1),%eax
  nopl   0x0(%rax)
L4:
  lea    (%rsi,%rax,1),%edx
  movsd  (%rbx,%rdx,8),%xmm0
  mov    %eax,%edx
  add    $0x1,%eax
  movsd  %xmm0,(%rdi,%rdx,8)
  cmp    %eax,%ecx
  jne    L4
  lea    0x1(%r8),%eax
  add    %r12d,%esi
  add    %r9d,%ecx
  cmp    %eax,%r11d
  je     L130
  mov    %eax,%r8d
  jmp    L115
L56:
  lea    D6(%rip),%rsi
  mov    $0x4286,%edi
  mov    %ecx,0x18(%rsp)
  call   <error_kernels@plt>
  mov    (%r12),%esi
  mov    0x18(%rsp),%ecx
  jmp    L98
  nopl   0x0(%rax)
L130:
  lea    0x1(%r15),%eax
  add    (%rsp),%r13d
  add    %ebp,%r14d
  cmp    %r15d,%r8d
  je     L53
  mov    %eax,%r15d
  jmp    L124
L53:
  mov    0x18(%rsp),%rbp
L77:
  test   %r9d,%r9d
  jle    L49
  mov    0x10(%rsp),%rax
  mov    %r9d,%r13d
  mov    $0x1,%ebx
  lea    0x1(%r9),%ecx
  imul   %r9d,%r13d
  sub    %eax,%ebx
  mov    %eax,%r12d
  sub    %eax,%ecx
  mov    %ebx,%r14d
  nopw   0x0(%rax,%rax,1)
L25:
  mov    %r14d,%edi
  mov    %r12d,%r11d
  mov    %ebx,%r8d
  imul   %r14d,%edi
  nopl   (%rax)
L112:
  mov    %r8d,%esi
  mov    %ebx,%edx
  lea    -0x1(%r11),%r10d
  imul   %r8d,%esi
  nopl   (%rax)
L23:
  mov    %edx,%eax
  pxor   %xmm0,%xmm0
  imul   %edx,%eax
  add    %esi,%eax
  add    %edi,%eax
  cvtsi2sd %eax,%xmm0
  comisd %xmm1,%xmm0
  jbe    L78
  mov    0x0(%rbp),%r15
  lea    (%r10,%rdx,1),%eax
  movq   $0x0,(%r15,%rax,8)
L78:
  add    $0x1,%edx
  cmp    %ecx,%edx
  jne    L23
  add    $0x1,%r8d
  add    %r9d,%r11d
  cmp    %r8d,%ecx
  jne    L112
  add    $0x1,%r14d
  add    %r13d,%r12d
  cmp    %r14d,%ecx
  jne    L25
L49:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: label: D9
type_infered: string
name: read_data
arguments: label: D6
type_infered: string

tool: D9: lib_vwk> Generating kernel with %d^3 = %lu voxels.


tool: D6: lib_vwk

assistant: ```c
void shrink_to_sigma_factor(double **outmap, unsigned *out_ext, double *inmap, unsigned in_ext, double sigmap, double sigma_factor) {
  int exth, indx, indy, indz;
  unsigned long nvox, index_old, index_new;
  unsigned margin;
  double cvalue, dsqu;
  char *program = "lib_vwk";
  exth = (int)ceil(sigma_factor * sigmap);
  *out_ext = 2 * exth - 1;
  if (*out_ext > in_ext || 2 * (in_ext / 2) == in_ext) {
    error_kernels(17030, program);
  }
  nvox = *out_ext * *out_ext * *out_ext;
  cvalue = sigma_factor * sigma_factor * sigmap * sigmap;
  printf("lib_vwk> Generating kernel with %d^3 = %lu voxels.\n", *out_ext, nvox);
  do_vect(outmap, nvox);
  margin = (in_ext - *out_ext) / 2;
  for (indz = margin; indz < (int)(in_ext - margin); indz++)
    for (indy = margin; indy < (int)(in_ext - margin); indy++)
      for (indx = margin; indx < (int)(in_ext - margin); indx++) {
        index_new = *out_ext * *out_ext * (indz - margin) + *out_ext * (indy - margin) + (indx - margin);
        index_old = in_ext * in_ext * indz + in_ext * indy + indx;
        *(*outmap + index_new) = *(inmap + index_old);
      }
  for (indz = 0; indz < (int)*out_ext; indz++)
    for (indy = 0; indy < (int)*out_ext; indy++)
      for (indx = 0; indx < (int)*out_ext; indx++) {
        index_new = (*out_ext) * (*out_ext) * indz + (*out_ext) * indy + indx;
        dsqu = (indx - exth + 1) * (indx - exth + 1) + (indy - exth + 1) * (indy - exth + 1) + (indz - exth + 1) * (indz - exth + 1);
        if (dsqu > cvalue)
          *(*outmap + index_new) = 0.0;
      }
}
```