user: What is the c source code of the assembly code below?

```asm
<vector_nd_alloc>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    (%rdx),%eax
  mov    %esi,0x8(%rsp)
  mov    %ecx,0xc(%rsp)
  cmp    $0x1,%ecx
  je     L128
  lea    D19(%rip),%r15
  lea    0x0(,%rax,8),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  call   <willus_mem_alloc_warn@plt>
  mov    (%r14),%r11d
  test   %r11d,%r11d
  jle    L181
  mov    0x0(%rbp),%rax
  movl   $0x0,0x4c(%rsp)
  mov    %rax,0x58(%rsp)
  mov    0xc(%rsp),%eax
  sub    $0x9,%eax
  mov    %eax,0x34(%rsp)
L12:
  cmpl   $0x2,0xc(%rsp)
  mov    0x4(%r14),%eax
  je     L103
  mov    0x58(%rsp),%rbx
  lea    0x0(,%rax,8),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x4(%r14),%r10d
  test   %r10d,%r10d
  jle    L264
  mov    (%rbx),%rax
  movl   $0x0,0x50(%rsp)
  mov    %rax,0x60(%rsp)
L105:
  cmpl   $0x3,0xc(%rsp)
  mov    0x8(%r14),%eax
  je     L21
  mov    0x60(%rsp),%rbx
  lea    0x0(,%rax,8),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x8(%r14),%r9d
  test   %r9d,%r9d
  jle    L243
  mov    (%rbx),%rax
  movl   $0x0,0x54(%rsp)
  mov    %rax,0x68(%rsp)
L39:
  cmpl   $0x4,0xc(%rsp)
  mov    0xc(%r14),%eax
  je     L94
  mov    0x68(%rsp),%rbx
  lea    0x0(,%rax,8),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0xc(%r14),%r8d
  test   %r8d,%r8d
  jle    L292
  mov    (%rbx),%rax
  movl   $0x0,0x24(%rsp)
  mov    %r14,%r13
  mov    %rax,0x28(%rsp)
L250:
  cmpl   $0x5,0xc(%rsp)
  mov    0x10(%r13),%eax
  je     L195
  mov    0x28(%rsp),%rbx
  lea    0x0(,%rax,8),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x10(%r13),%edi
  test   %edi,%edi
  jle    L151
  mov    (%rbx),%rax
  movl   $0x0,0x20(%rsp)
  mov    %rax,0x18(%rsp)
L0:
  cmpl   $0x6,0xc(%rsp)
  mov    0x14(%r13),%esi
  je     L83
  mov    0x18(%rsp),%rbx
  shl    $0x3,%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x14(%r13),%esi
  test   %esi,%esi
  jle    L197
  movl   $0x0,0x30(%rsp)
  mov    (%rbx),%r12
L301:
  cmpl   $0x7,0xc(%rsp)
  mov    0x18(%r13),%esi
  je     L328
  mov    $0xa,%ecx
  shl    $0x3,%esi
  mov    %r15,%rdx
  mov    %r12,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x18(%r13),%ecx
  test   %ecx,%ecx
  jle    L285
  mov    %r12,0x10(%rsp)
  mov    (%r12),%rbx
  xor    %ebp,%ebp
L266:
  cmpl   $0x8,0xc(%rsp)
  mov    0x1c(%r13),%esi
  je     L96
  mov    %r15,%rdx
  shl    $0x3,%esi
  mov    $0xa,%ecx
  mov    %rbx,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x1c(%r13),%edx
  test   %edx,%edx
  jle    L295
  mov    (%rbx),%r12
  xor    %r14d,%r14d
L100:
  cmpl   $0x9,0xc(%rsp)
  mov    0x20(%r13),%esi
  je     L263
  shl    $0x3,%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %r12,%rdi
  call   <willus_mem_alloc_warn@plt>
  mov    0x20(%r13),%eax
  test   %eax,%eax
  jle    L142
  mov    (%r12),%rdi
  lea    0x24(%r13),%rdx
  xor    %eax,%eax
  mov    %ebp,0x48(%rsp)
  mov    %rbx,0x38(%rsp)
  mov    %rdx,%rbp
  mov    %eax,%ebx
  mov    %r12,0x40(%rsp)
  mov    %rdi,%r12
L293:
  mov    0x34(%rsp),%ecx
  mov    0x8(%rsp),%esi
  mov    %r12,%rdi
  mov    %rbp,%rdx
  add    $0x1,%ebx
  add    $0x8,%r12
  call   <vector_nd_alloc>
  cmp    0x20(%r13),%ebx
  jl     L293
  mov    0x48(%rsp),%ebp
  mov    0x38(%rsp),%rbx
  mov    0x40(%rsp),%r12
L142:
  add    $0x1,%r14d
  add    $0x8,%r12
  cmp    0x1c(%r13),%r14d
  jl     L100
L295:
  add    $0x1,%ebp
  add    $0x8,%rbx
  cmp    0x18(%r13),%ebp
  jl     L266
L354:
  mov    0x10(%rsp),%r12
L285:
  addl   $0x1,0x30(%rsp)
  add    $0x8,%r12
  mov    0x30(%rsp),%eax
  cmp    0x14(%r13),%eax
  jl     L301
L197:
  addl   $0x1,0x20(%rsp)
  mov    0x20(%rsp),%eax
  addq   $0x8,0x18(%rsp)
  cmp    0x10(%r13),%eax
  jl     L0
L151:
  addl   $0x1,0x24(%rsp)
  mov    0x24(%rsp),%eax
  addq   $0x8,0x28(%rsp)
  cmp    0xc(%r13),%eax
  jl     L250
  mov    %r13,%r14
L292:
  addl   $0x1,0x54(%rsp)
  mov    0x54(%rsp),%eax
  addq   $0x8,0x68(%rsp)
  cmp    0x8(%r14),%eax
  jl     L39
L243:
  addl   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%eax
  addq   $0x8,0x60(%rsp)
  cmp    0x4(%r14),%eax
  jl     L105
L264:
  addl   $0x1,0x4c(%rsp)
  mov    0x4c(%rsp),%eax
  addq   $0x8,0x58(%rsp)
  cmp    %eax,(%r14)
  jg     L12
L181:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L263:
  imul   0x8(%rsp),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %r12,%rdi
  call   <willus_mem_alloc_warn@plt>
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L96:
  imul   0x8(%rsp),%esi
  mov    %rbx,%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  add    $0x1,%ebp
  add    $0x8,%rbx
  call   <willus_mem_alloc_warn@plt>
  cmp    0x18(%r13),%ebp
  jl     L266
  jmp    L354
L328:
  imul   0x8(%rsp),%esi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %r12,%rdi
  call   <willus_mem_alloc_warn@plt>
  jmp    L285
L83:
  imul   0x8(%rsp),%esi
  mov    0x18(%rsp),%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  call   <willus_mem_alloc_warn@plt>
  jmp    L197
L195:
  imul   0x8(%rsp),%eax
  mov    0x28(%rsp),%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %eax,%esi
  call   <willus_mem_alloc_warn@plt>
  jmp    L151
L94:
  imul   0x8(%rsp),%eax
  mov    0x68(%rsp),%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %eax,%esi
  call   <willus_mem_alloc_warn@plt>
  jmp    L292
L21:
  imul   0x8(%rsp),%eax
  mov    0x60(%rsp),%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %eax,%esi
  call   <willus_mem_alloc_warn@plt>
  jmp    L243
L103:
  imul   0x8(%rsp),%eax
  mov    0x58(%rsp),%rdi
  mov    $0xa,%ecx
  mov    %r15,%rdx
  mov    %eax,%esi
  call   <willus_mem_alloc_warn@plt>
  jmp    L264
L128:
  imul   %eax,%esi
  add    $0x78,%rsp
  mov    $0xa,%ecx
  pop    %rbx
  lea    D19(%rip),%rdx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <willus_mem_alloc_warn@plt>
```

tool_calls: name: read_data
arguments: data_tag: D19
type_guessed: string

tool: D19: vector_nd_alloc

assistant: ```c
void vector_nd_alloc(void **ptr, int element_size, int *dims, int n) {
  static char *funcname = "vector_nd_alloc";
  int i;
  void **p2;
  if (n == 1) {
    willus_mem_alloc_warn(ptr, element_size * dims[0], funcname, 10);
    return;
  }
  willus_mem_alloc_warn(ptr, sizeof(void *) * dims[0], funcname, 10);
  p2 = (void **)(*ptr);
  for (i = 0; i < dims[0]; i++)
    vector_nd_alloc(&p2[i], element_size, &dims[1], n - 1);
}
```