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     L106
  test   $0x1,%cl
  je     L106
L52:
  movsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm3
  mov    %esi,%r13d
  lea    D4(%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,0x8(%rsp)
  call   <printf@plt>
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <do_vect@plt>
  mov    0x18(%rsp),%ecx
  mov    (%r12),%r9d
  movsd  0x8(%rsp),%xmm1
  mov    %ecx,%r12d
  mov    %ecx,%r11d
  sub    %r9d,%r12d
  mov    %r12d,%edi
  shr    %edi
  sub    %edi,%r11d
  mov    %edi,(%rsp)
  cmp    %edi,%r11d
  jle    L98
  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,0x8(%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
  nop
L49:
  mov    (%rsp),%r8d
  mov    %r14d,%ecx
  mov    %r13d,%esi
  nopw   0x0(%rax,%rax,1)
L6:
  lea    (%r10,%rcx,1),%eax
  nopl   0x0(%rax)
L81:
  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    L81
  lea    0x1(%r8),%eax
  add    %r12d,%esi
  add    %r9d,%ecx
  cmp    %eax,%r11d
  je     L77
  mov    %eax,%r8d
  jmp    L6
L106:
  lea    D11(%rip),%rsi
  mov    $0x4286,%edi
  mov    %ecx,0x18(%rsp)
  call   <error_kernels@plt>
  mov    (%r12),%esi
  mov    0x18(%rsp),%ecx
  jmp    L52
  nopl   0x0(%rax)
L77:
  lea    0x1(%r15),%eax
  add    0x8(%rsp),%r13d
  add    %ebp,%r14d
  cmp    %r15d,%r8d
  je     L9
  mov    %eax,%r15d
  jmp    L49
L9:
  mov    0x18(%rsp),%rbp
L98:
  test   %r9d,%r9d
  jle    L29
  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
  nopl   0x0(%rax,%rax,1)
L1:
  mov    %r14d,%edi
  mov    %r12d,%r11d
  mov    %ebx,%r8d
  imul   %r14d,%edi
  nopl   (%rax)
L39:
  mov    %r8d,%esi
  mov    %ebx,%edx
  lea    -0x1(%r11),%r10d
  imul   %r8d,%esi
  nopl   (%rax)
L11:
  mov    %edx,%eax
  pxor   %xmm0,%xmm0
  imul   %edx,%eax
  add    %esi,%eax
  add    %edi,%eax
  cvtsi2sd %eax,%xmm0
  comisd %xmm1,%xmm0
  jbe    L76
  mov    0x0(%rbp),%r15
  lea    (%r10,%rdx,1),%eax
  movq   $0x0,(%r15,%rax,8)
L76:
  add    $0x1,%edx
  cmp    %ecx,%edx
  jne    L11
  add    $0x1,%r8d
  add    %r9d,%r11d
  cmp    %r8d,%ecx
  jne    L39
  add    $0x1,%r14d
  add    %r13d,%r12d
  cmp    %r14d,%ecx
  jne    L1
L29:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D4
data_type: string
name: unpack_data
arguments: data_label: D11
data_type: string

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


tool: D11: 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;
      }
}
```