user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<shrink_to_sigma_factor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %ecx,-0x6c(%rbp)
  movsd  %xmm0,-0x78(%rbp)
  movsd  %xmm1,-0x80(%rbp)
  lea    D6(%rip),%rax
  mov    %rax,-0x30(%rbp)
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x6c(%rbp)
  jb     L68
  mov    -0x6c(%rbp),%eax
  and    $0xfffffffe,%eax
  cmp    %eax,-0x6c(%rbp)
  jne    L45
L68:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4286,%edi
  call   <error_kernels@plt>
L45:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  mov    %eax,%eax
  mov    %rax,-0x28(%rbp)
  movsd  -0x80(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movsd  -0x78(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x28(%rbp),%rdx
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x28(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <do_vect@plt>
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x6c(%rbp),%eax
  sub    %edx,%eax
  shr    %eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  jmp    L0
L132:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  jmp    L135
L53:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  jmp    L131
L74:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x3c(%rbp),%eax
  sub    -0x34(%rbp),%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%eax
  sub    -0x34(%rbp),%eax
  imul   %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x44(%rbp),%eax
  sub    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x6c(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  imul   %eax,%edx
  mov    -0x40(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  add    %eax,%edx
  mov    -0x44(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%eax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rax
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x44(%rbp)
L131:
  mov    -0x6c(%rbp),%eax
  sub    -0x34(%rbp),%eax
  cmp    %eax,-0x44(%rbp)
  jl     L74
  addl   $0x1,-0x40(%rbp)
L135:
  mov    -0x6c(%rbp),%eax
  sub    -0x34(%rbp),%eax
  cmp    %eax,-0x40(%rbp)
  jl     L53
  addl   $0x1,-0x3c(%rbp)
L0:
  mov    -0x6c(%rbp),%eax
  sub    -0x34(%rbp),%eax
  cmp    %eax,-0x3c(%rbp)
  jl     L132
  movl   $0x0,-0x3c(%rbp)
  jmp    L27
L146:
  movl   $0x0,-0x40(%rbp)
  jmp    L134
L70:
  movl   $0x0,-0x44(%rbp)
  jmp    L137
L63:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%eax
  imul   %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x44(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  sub    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x44(%rbp),%eax
  sub    -0x38(%rbp),%eax
  add    $0x1,%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x40(%rbp),%eax
  sub    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x40(%rbp),%eax
  sub    -0x38(%rbp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  add    %eax,%ecx
  mov    -0x3c(%rbp),%eax
  sub    -0x38(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x3c(%rbp),%eax
  sub    -0x38(%rbp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  add    %ecx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L83
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
L83:
  addl   $0x1,-0x44(%rbp)
L137:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x44(%rbp)
  jl     L63
  addl   $0x1,-0x40(%rbp)
L134:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x40(%rbp)
  jl     L70
  addl   $0x1,-0x3c(%rbp)
L27:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x3c(%rbp)
  jl     L146
  nop
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D6
type_infered: string
name: extract_symbolic_data
arguments: data_label: D17
type_infered: string

tool: D6: lib_vwk

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


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;
      }
}
```