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

```asm
<prtable>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %r9,0x20(%rsp)
  test   %esi,%esi
  jne    L8
L175:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L8:
  mov    %esi,%r15d
  mov    %edx,%ebx
  mov    %ecx,%ebp
  mov    %r9,%rdx
  call   <get_maxlen@plt>
  lea    0x1(%rax),%edi
  mov    %edi,0x28(%rsp)
  test   %ebx,%ebx
  jle    L78
L188:
  lea    -0x1(%r15),%eax
  cltd
  idiv   %ebx
  mov    %eax,0x38(%rsp)
  lea    0x1(%rax),%edi
  mov    %edi,0x2c(%rsp)
  movl   $0x1,0x34(%rsp)
  mov    %edi,0x3c(%rsp)
  lea    -0x1(%r15),%eax
  mov    %eax,0x30(%rsp)
  test   %edi,%edi
  jg     L126
L170:
  mov    $0x0,%eax
  call   <refresh@plt>
  jmp    L175
L78:
  mov    %ebp,%eax
  cltd
  idiv   %edi
  test   %eax,%eax
  mov    $0x5,%ebx
  cmovne %eax,%ebx
  jmp    L188
L55:
  mov    $0x0,%ebp
  mov    %ebp,%edx
  mov    $0x0,%ebx
  mov    %ebx,%esi
  mov    D8(%rip),%rax
  mov    (%rax),%edi
  call   <getyx@plt>
  mov    %ebp,%edi
  call   <__USE@plt>
  lea    0x1(%rbx),%edi
  mov    $0x0,%esi
  call   <move@plt>
  mov    0x34(%rsp),%edi
  lea    0x1(%rdi),%eax
  cmp    %edi,0x38(%rsp)
  jl     L170
  mov    %eax,0x34(%rsp)
L126:
  test   %r15d,%r15d
  jle    L55
  mov    0x34(%rsp),%edx
  cmp    $0x1,%edx
  jle    L136
  mov    $0x1,%ebx
L163:
  cmp    %ebx,%r15d
  je     L55
  lea    0x1(%rbx),%eax
  cmp    %edx,%eax
  je     L176
  mov    %eax,%ebx
  jmp    L163
L176:
  mov    0x34(%rsp),%ebp
L193:
  mov    0x3c(%rsp),%r13d
  add    0x34(%rsp),%r13d
  mov    0x28(%rsp),%eax
  mov    %eax,0xc(%rsp)
  mov    $0x0,%r12d
  jmp    L140
L136:
  mov    $0x0,%ebx
  mov    $0x1,%ebp
  jmp    L193
L151:
  mov    0x28(%rsp),%esi
  add    %esi,0xc(%rsp)
  add    0x2c(%rsp),%r13d
  mov    %edx,%ebx
  mov    %eax,%ebp
  jmp    L140
L200:
  mov    0xc(%rsp),%edi
  mov    %edi,%r14d
  mov    %eax,%ebp
  mov    %edx,%ebx
  cmp    %edi,%r12d
  jge    L151
L191:
  mov    $0x20,%edi
  call   <addch@plt>
  add    $0x1,%r12d
  cmp    %r14d,%r12d
  jne    L191
  mov    %r14d,%r12d
L208:
  mov    0x28(%rsp),%esi
  add    %esi,0xc(%rsp)
  add    0x2c(%rsp),%r13d
  cmp    %ebx,%r15d
  jle    L55
L140:
  mov    %ebx,%esi
  mov    0x10(%rsp),%r14
  mov    %r14,%rdi
  mov    0x18(%rsp),%rax
  call   *%rax
  mov    %ebx,%esi
  mov    %r14,%rdi
  mov    0x20(%rsp),%rax
  call   *%rax
  add    %eax,%r12d
  lea    0x1(%rbx),%edx
  cmp    %edx,%r15d
  jle    L55
  lea    0x1(%rbp),%eax
  mov    %r13d,%ecx
  cmp    %r13d,%eax
  jge    L200
  mov    %ebp,%esi
  add    0x30(%rsp),%ebp
  sub    %ebx,%ebp
  sub    %esi,%edx
L10:
  lea    (%rdx,%rax,1),%ebx
  cmp    %eax,%ebp
  je     L208
  add    $0x1,%eax
  cmp    %ecx,%eax
  jne    L10
  mov    0xc(%rsp),%eax
  mov    %eax,%r14d
  mov    %ecx,%ebp
  cmp    %eax,%r12d
  jl     L191
  jmp    L208
```

assistant: ```c
void prtable(const char *const base[], int num, int d_cols, int width, void (*prentry)(const char *const[], int), int (*length)(const char *const[], int)) {
  int c, j;
  int a, b, cols, loc, maxlen, nrows, z;
  int col, row;
  if (num == 0)
    return;
  maxlen = get_maxlen(base, num, length) + 1;
  if (d_cols > 0)
    cols = d_cols;
  else
    cols = width / maxlen;
  if (cols == 0)
    cols = 5;
  nrows = (num - 1) / cols + 1;
  for (a = 1; a <= nrows; a++) {
    b = c = z = loc = 0;
    for (j = 0; j < num; j++) {
      c++;
      if (c >= a + b)
        break;
    }
    while (j < num) {
      (*prentry)(base, j);
      loc += (*length)(base, j);
      z++;
      b += nrows;
      for (j++; j < num; j++) {
        c++;
        if (c >= a + b)
          break;
      }
      if (j < num) {
        while (loc < z * maxlen) {
          addch(' ');
          loc++;
        }
      }
    }
    getyx(stdscr, row, col);
    __USE(col);
    move(row + 1, 0);
  }
  refresh();
}
```