user: 请将以下的汇编代码转换成C语言代码：

```asm
<PrintNum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  mov    0x10(%rbp),%eax
  mov    %al,-0x44(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L119:
  mov    -0x34(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %rdx,%rax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x9,-0xc(%rbp)
  jg     L183
  mov    -0xc(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L6
L183:
  cmpl   $0x0,0x18(%rbp)
  je     L165
  mov    -0xc(%rbp),%eax
  lea    0x37(%rax),%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L6
L165:
  mov    -0xc(%rbp),%eax
  lea    0x57(%rax),%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L6:
  mov    -0x34(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  div    %rsi
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L119
  cmpl   $0x0,-0x38(%rbp)
  je     L35
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x2d,(%rax)
L35:
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,-0x10(%rbp)
  mov    -0x3c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L83
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L83:
  cmpl   $0x0,-0x40(%rbp)
  je     L159
  movb   $0x20,-0x44(%rbp)
L159:
  cmpl   $0x0,-0x38(%rbp)
  je     L16
  cmpl   $0x0,-0x40(%rbp)
  jne    L16
  cmpb   $0x30,-0x44(%rbp)
  jne    L16
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L120
L73:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x44(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L120:
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L73
  mov    -0x3c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2d,(%rax)
  jmp    L74
L16:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L136
L104:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x44(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L136:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L104
L74:
  movl   $0x0,-0x18(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  je     L61
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L44
L61:
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L44
L42:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1d(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x18(%rbp)
  subl   $0x1,-0x14(%rbp)
L44:
  mov    -0x14(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jg     L42
  mov    -0x3c(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int PrintNum(char *buf, unsigned long u, int base, int negFlag, int length, int ladjust, char padc, int upcase) {
  int actualLength = 0;
  char *p = buf;
  int i;
  do {
    int tmp = u % base;
    if (tmp <= 9) {
      *p++ = '0' + tmp;
    } else if (upcase) {
      *p++ = 'A' + tmp - 10;
    } else {
      *p++ = 'a' + tmp - 10;
    }
    u /= base;
  } while (u != 0);
  if (negFlag) {
    *p++ = '-';
  }
  actualLength = p - buf;
  if (length < actualLength)
    length = actualLength;
  if (ladjust) {
    padc = ' ';
  }
  if (negFlag && !ladjust && (padc == '0')) {
    for (i = actualLength - 1; i < length - 1; i++)
      buf[i] = padc;
    buf[length - 1] = '-';
  } else {
    for (i = actualLength; i < length; i++)
      buf[i] = padc;
  }
  {
    int begin = 0;
    int end;
    if (ladjust) {
      end = actualLength - 1;
    } else {
      end = length - 1;
    }
    while (end > begin) {
      char tmp = buf[begin];
      buf[begin] = buf[end];
      buf[end] = tmp;
      begin++;
      end--;
    }
  }
  return length;
}
```