user: Please show me the C implementation that matches the assembly code listed below:

```asm
<canny>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%esi
  mov    -0x8(%rbp),%r8
  mov    -0x28(%rbp),%rax
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <canny_aux@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edi
  mov    -0x38(%rbp),%rax
  mov    (%rax),%r9d
  mov    -0x30(%rbp),%rax
  mov    (%rax),%r8d
  mov    -0x50(%rbp),%rax
  mov    (%rax),%esi
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x8(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  sub    $0x8,%rsp
  push   %rdi
  mov    %eax,%edi
  call   <hysteresis@plt>
  add    $0x10,%rsp
  movl   $0x0,-0x10(%rbp)
  jmp    L19
L20:
  movl   $0x0,-0x14(%rbp)
  jmp    L50
L27:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0xff,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  imul   %eax,%edx
  mov    -0x14(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0xff,(%rax)
  addl   $0x1,-0x14(%rbp)
L50:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L27
  movl   $0x0,-0x14(%rbp)
  jmp    L43
L57:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0xff,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  imul   -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0xff,(%rax)
  addl   $0x1,-0x14(%rbp)
L43:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L57
  addl   $0x1,-0x10(%rbp)
L19:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L20
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void canny(int *image, int *width, int *height, int *depth, double *s, int *low, int *high) {
  int plane_size = *width * *height * *depth;
  int *magim, i, d;
  magim = (int *)malloc(plane_size * sizeof(int));
  canny_aux(image, *width, *height, *depth, *s, magim);
  hysteresis(*high, *low, image, magim, *width, *height, *depth);
  for (d = 0; d < *depth; d++) {
    for (i = 0; i < *height; i++) {
      image[((*height) * (0) + (i) + (*width) * (*height) * (d))] = 255;
      image[((*height) * (*width - 1) + (i) + (*width) * (*height) * (d))] = 255;
    }
    for (i = 0; i < *width; i++) {
      image[((*height) * (i) + (0) + (*width) * (*height) * (d))] = 255;
      image[((*height) * (i) + (*height - 1) + (*width) * (*height) * (d))] = 255;
    }
  }
  free(magim);
}
```