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

```asm
<embed>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  lea    0x2(%r15),%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    (%rdx),%ebx
  mov    (%rcx),%r12d
  mov    (%r8),%esi
  mov    %rdx,0x30(%rsp)
  lea    (%rbx,%r14,2),%edi
  lea    (%r12,%r14,2),%r13d
  mov    %rcx,0x38(%rsp)
  mov    %edi,%eax
  mov    %edi,0x28(%rsp)
  imul   %r13d,%eax
  mov    %esi,0x18(%rsp)
  mov    %eax,%edi
  mov    %eax,0x1c(%rsp)
  imul   %esi,%edi
  mov    $0x4,%esi
  movslq %edi,%rdi
  call   <calloc@plt>
  mov    0x18(%rsp),%edx
  mov    %rax,0x10(%rsp)
  test   %edx,%edx
  jle    L123
  mov    %r12d,%esi
  imul   %ebx,%esi
  mov    %esi,0x20(%rsp)
  test   %r13d,%r13d
  jle    L123
  mov    0x28(%rsp),%eax
  test   %eax,%eax
  jle    L123
  cmp    $0x1,%r12d
  jne    L96
  mov    0x28(%rsp),%esi
  mov    %ebx,%eax
  movslq %r13d,%r8
  xor    %edi,%edi
  sub    %r15d,%eax
  shl    $0x2,%r8
  xor    %r12d,%r12d
  xor    %r11d,%r11d
  lea    -0x2(%rsi,%rax,1),%r9d
L98:
  mov    0x10(%rsp),%rsi
  movslq %r12d,%rax
  xor    %r10d,%r10d
  lea    (%rsi,%rax,4),%r15
L143:
  mov    %ebx,%ecx
  mov    %r15,%rsi
  sub    %r14d,%ecx
  nopl   0x0(%rax,%rax,1)
L76:
  mov    %ecx,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  jns    L85
  add    %ebx,%edx
L85:
  add    %edi,%edx
  add    $0x1,%ecx
  movslq %edx,%rdx
  mov    0x0(%rbp,%rdx,4),%eax
  mov    %eax,(%rsi)
  add    %r8,%rsi
  cmp    %r9d,%ecx
  jne    L76
  add    $0x1,%r10d
  add    $0x4,%r15
  cmp    %r10d,%r13d
  jne    L143
  add    $0x1,%r11d
  add    0x1c(%rsp),%r12d
  add    0x20(%rsp),%edi
  cmp    %r11d,0x18(%rsp)
  jne    L98
L123:
  mov    0x30(%rsp),%rax
  mov    0x28(%rsp),%edi
  mov    %edi,(%rax)
  mov    0x38(%rsp),%rax
  mov    %r13d,(%rax)
  mov    0x10(%rsp),%rax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L96:
  mov    $0xfffffffe,%eax
  movl   $0x0,0x2c(%rsp)
  movslq %r13d,%r10
  xor    %r9d,%r9d
  sub    %r15d,%eax
  movl   $0x0,0x24(%rsp)
  shl    $0x2,%r10
  lea    (%r12,%rax,1),%edi
  add    %ebx,%eax
  mov    %edi,0xc(%rsp)
  mov    0x28(%rsp),%edi
  lea    (%rax,%rdi,1),%r8d
L142:
  movslq 0x2c(%rsp),%rax
  mov    0x10(%rsp),%rdi
  xor    %r11d,%r11d
  lea    (%rdi,%rax,4),%r15
  xchg   %ax,%ax
L145:
  mov    0xc(%rsp),%eax
  mov    %ebx,%ecx
  mov    %r15,%rsi
  add    %r11d,%eax
  cltd
  idiv   %r12d
  test   %edx,%edx
  lea    (%rdx,%r12,1),%eax
  cmovns %edx,%eax
  sub    %r14d,%ecx
  mov    %eax,%edi
  xchg   %ax,%ax
L12:
  mov    %ecx,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  js     L80
  imul   %r12d,%edx
  add    $0x1,%ecx
  lea    (%rdx,%rdi,1),%eax
  add    %r9d,%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  mov    %eax,(%rsi)
  add    %r10,%rsi
  cmp    %r8d,%ecx
  jne    L12
L29:
  add    $0x1,%r11d
  add    $0x4,%r15
  cmp    %r11d,%r13d
  jne    L145
  addl   $0x1,0x24(%rsp)
  mov    0x1c(%rsp),%esi
  mov    0x24(%rsp),%eax
  add    %esi,0x2c(%rsp)
  add    0x20(%rsp),%r9d
  cmp    %eax,0x18(%rsp)
  jne    L142
  jmp    L123
  nopl   0x0(%rax,%rax,1)
L80:
  lea    (%rbx,%rdx,1),%eax
  add    $0x1,%ecx
  imul   %r12d,%eax
  add    %edi,%eax
  add    %r9d,%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  mov    %eax,(%rsi)
  add    %r10,%rsi
  cmp    %ecx,%r8d
  jne    L12
  jmp    L29
```

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