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

```asm
<printnum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x5c(%rbp)
  mov    %r8d,-0x60(%rbp)
  mov    %r9d,-0x64(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    %rax,%r10
  mov    $0x0,%r11d
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L26:
  cmp    %rdx,%rsp
  je     L116
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L26
L116:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L98
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L98:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x3c(%rbp)
L5:
  mov    -0x5c(%rbp),%ecx
  mov    -0x58(%rbp),%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %rdx,%rcx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    -0x30(%rbp),%rdx
  cltq
  mov    %ecx,(%rdx,%rax,4)
  mov    -0x5c(%rbp),%eax
  cmp    %rax,-0x58(%rbp)
  jb     L51
  mov    -0x5c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  mov    $0x0,%edx
  div    %rsi
  mov    %rax,-0x58(%rbp)
  jmp    L5
L51:
  nop
  jmp    L71
L81:
  mov    -0x50(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    -0x48(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   *%rcx
L71:
  mov    -0x60(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x60(%rbp)
  cmp    %eax,-0x3c(%rbp)
  jl     L81
  jmp    L13
L70:
  mov    -0x30(%rbp),%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cmp    $0x9,%eax
  jbe    L74
  mov    $0x57,%eax
  jmp    L69
L74:
  mov    $0x30,%eax
L69:
  add    %ecx,%eax
  mov    %eax,%ecx
  mov    -0x50(%rbp),%rax
  mov    -0x48(%rbp),%rdx
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   *%rdx
L13:
  mov    -0x3c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  test   %eax,%eax
  jg     L70
  mov    %rbx,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L108
  call   <__stack_chk_fail@plt>
L108:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
void printnum(void (*putch)(int, void **), void **putdat, unsigned long long num, unsigned base, int width, int padc) {
  unsigned digs[sizeof(num) * CHAR_BIT];
  int pos = 0;
  for (;;) {
    digs[pos++] = num % base;
    if (num < base)
      break;
    num /= base;
  }
  while (width-- > pos) {
    putch(padc, putdat);
  }
  while (pos-- > 0) {
    putch(digs[pos] + (digs[pos] >= 10 ? 'a' - 10 : '0'), putdat);
  }
}
```