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

```asm
<embed>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  addl   $0x2,-0x3c(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  add    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  add    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  imul   -0x14(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  cltq
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L35
L51:
  movl   $0x0,-0x30(%rbp)
  jmp    L72
L68:
  movl   $0x0,-0x2c(%rbp)
  jmp    L13
L8:
  mov    -0x30(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x24(%rbp)
  mov    %edx,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x20(%rbp)
  mov    %edx,-0xc(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jns    L78
  mov    -0x10(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  jmp    L10
L78:
  mov    -0x10(%rbp),%eax
L10:
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L2
  mov    -0xc(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  jmp    L25
L2:
  mov    -0xc(%rbp),%eax
L25:
  mov    %eax,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %eax,%edx
  mov    -0x20(%rbp),%eax
  imul   -0x24(%rbp),%eax
  imul   -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x14(%rbp),%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x18(%rbp),%eax
  imul   -0x14(%rbp),%eax
  imul   -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L13:
  mov    -0x2c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L8
  addl   $0x1,-0x30(%rbp)
L72:
  mov    -0x30(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L68
  addl   $0x1,-0x28(%rbp)
L35:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L51
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    -0x14(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  leave
  ret
```

assistant: ```c
int *embed(int *im, int outline, int *width, int *height, int *depth) {
  int i, j, d, I, J;
  int *new;
  int h = *height, w = *width, k = *depth;
  int new_width, new_height;
  outline = outline + 2;
  new_width = w + outline + outline;
  new_height = h + outline + outline;
  new = (int *)calloc(new_width * new_height * k, sizeof(int));
  for (d = 0; d < k; d++) {
    for (i = 0; i < new_height; i++) {
      for (j = 0; j < new_width; j++) {
        I = (i - outline + h) % h;
        J = (j - outline + w) % w;
        I = (I < 0) ? I + h : I;
        J = (J < 0) ? J + w : J;
        new[((new_height) * (j) + (i) + (new_width) * (new_height) * (d))] = im[((h) * (J) + (I) + (w) * (h) * (d))];
      }
    }
  }
  im = new;
  *width = new_width;
  *height = new_height;
  return im;
}
```