user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<shen_castan_aux>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %esi,%r14d
  mov    %edx,%r13d
  mov    %ecx,%r15d
  mov    %r8,0x10(%rsp)
  mov    %esi,%ebp
  imul   %edx,%ebp
  imul   %ecx,%ebp
  movslq %ebp,%rax
  mov    %rax,0x8(%rsp)
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,%rbx
  test   %ebp,%ebp
  jle    L16
  lea    -0x1(%rbp),%eax
  mov    %rax,0x18(%rsp)
  mov    %ebp,%ebp
  mov    $0x0,%eax
L11:
  pxor   %xmm0,%xmm0
  cvtsi2ssl (%r12,%rax,4),%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %rbp,%rax
  jne    L11
  mov    $0x4,%esi
  mov    0x8(%rsp),%rdi
  call   <calloc@plt>
  mov    %rax,%rbp
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %rax,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <compute_ISEF@plt>
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <compute_bli@plt>
  movslq %eax,%r12
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <locate_zero_crossings@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    0x10(%rsp),%r14
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <threshold_edges@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %r14,%rax
  mov    0x18(%rsp),%rcx
  lea    0x4(%r14,%rcx,4),%rdi
  mov    $0x0,%esi
  mov    $0xff,%ecx
L5:
  cmpl   $0x0,(%rax)
  mov    %ecx,%edx
  cmovg  %esi,%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rdi
  jne    L5
L6:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  mov    $0x4,%esi
  mov    0x8(%rsp),%rdi
  call   <calloc@plt>
  mov    %rax,%r12
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %rax,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <compute_ISEF@plt>
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <compute_bli@plt>
  movslq %eax,%rbp
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <locate_zero_crossings@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15d,%r8d
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <threshold_edges@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L6
```

assistant: ```c
void shen_castan_aux(int *image, int width, int height, int depth, int *ret) {
  register int i;
  float *buffer;
  float *smoothed_buffer;
  int *bli_buffer, plane_size = width * height * depth;
  buffer = (float *)calloc(plane_size, sizeof(float));
  for (i = 0; i < plane_size; i++) {
    buffer[i] = (float)image[i];
  }
  smoothed_buffer = (float *)calloc(plane_size, sizeof(float));
  compute_ISEF(buffer, smoothed_buffer, height, width, depth);
  bli_buffer = compute_bli(smoothed_buffer, buffer, height, width, depth);
  locate_zero_crossings(buffer, smoothed_buffer, bli_buffer, height, width, depth);
  free(smoothed_buffer);
  free(bli_buffer);
  threshold_edges(buffer, ret, height, width, depth);
  free(buffer);
  for (i = 0; i < plane_size; i++)
    ret[i] = (ret[i] > 0) ? 0 : 255;
}
```